mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
d_path: Make d_path() use a struct path
d_path() is used on a <dentry,vfsmount> pair. Lets use a struct path to reflect this. [[email protected]: fix build in mm/memory.c] Signed-off-by: Jan Blunck <[email protected]> Acked-by: Bryan Wu <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Cc: Al Viro <[email protected]> Cc: "J. Bruce Fields" <[email protected]> Cc: Neil Brown <[email protected]> Cc: Michael Halcrow <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c32c2f63a9
commit
cf28b4863f
12 changed files with 24 additions and 36 deletions
12
fs/dcache.c
12
fs/dcache.c
|
|
@ -1845,8 +1845,7 @@ Elong:
|
|||
|
||||
/**
|
||||
* d_path - return the path of a dentry
|
||||
* @dentry: dentry to report
|
||||
* @vfsmnt: vfsmnt to which the dentry belongs
|
||||
* @path: path to report
|
||||
* @buf: buffer to return value in
|
||||
* @buflen: buffer length
|
||||
*
|
||||
|
|
@ -1857,8 +1856,7 @@ Elong:
|
|||
*
|
||||
* "buflen" should be positive. Caller holds the dcache_lock.
|
||||
*/
|
||||
char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
|
||||
char *buf, int buflen)
|
||||
char *d_path(struct path *path, char *buf, int buflen)
|
||||
{
|
||||
char *res;
|
||||
struct path root;
|
||||
|
|
@ -1870,15 +1868,15 @@ char *d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
|
|||
* user wants to identify the object in /proc/pid/fd/. The little hack
|
||||
* below allows us to generate a name for these objects on demand:
|
||||
*/
|
||||
if (dentry->d_op && dentry->d_op->d_dname)
|
||||
return dentry->d_op->d_dname(dentry, buf, buflen);
|
||||
if (path->dentry->d_op && path->dentry->d_op->d_dname)
|
||||
return path->dentry->d_op->d_dname(path->dentry, buf, buflen);
|
||||
|
||||
read_lock(¤t->fs->lock);
|
||||
root = current->fs->root;
|
||||
path_get(¤t->fs->root);
|
||||
read_unlock(¤t->fs->lock);
|
||||
spin_lock(&dcache_lock);
|
||||
res = __d_path(dentry, vfsmnt, &root, buf, buflen);
|
||||
res = __d_path(path->dentry, path->mnt, &root, buf, buflen);
|
||||
spin_unlock(&dcache_lock);
|
||||
path_put(&root);
|
||||
return res;
|
||||
|
|
|
|||
Loading…
Reference in a new issue