[PATCH 06/13] Introduce path_put()

2007-10-22 Thread Bharata B Rao
From: Jan Blunck <[EMAIL PROTECTED]>

* Add path_put() functions for releasing a reference to the dentry and
  vfsmount of a struct path in the right order

* Switch from path_release(nd) to path_put(>path)

* Rename dput_path() to path_put_conditional()

Signed-off-by: Jan Blunck <[EMAIL PROTECTED]>
Signed-off-by: Andreas Gruenbacher <[EMAIL PROTECTED]>
Signed-off-by: Bharata B Rao <[EMAIL PROTECTED]>
---
 arch/alpha/kernel/osf_sys.c  |2 
 arch/mips/kernel/sysirix.c   |6 +-
 arch/parisc/hpux/sys_hpux.c  |2 
 arch/powerpc/platforms/cell/spufs/syscalls.c |2 
 arch/sparc64/solaris/fs.c|4 -
 drivers/md/dm-table.c|2 
 drivers/mtd/mtdsuper.c   |4 -
 fs/afs/mntpt.c   |2 
 fs/autofs4/root.c|2 
 fs/block_dev.c   |2 
 fs/coda/pioctl.c |4 -
 fs/compat.c  |4 -
 fs/configfs/symlink.c|4 -
 fs/dquot.c   |2 
 fs/ecryptfs/main.c   |2 
 fs/exec.c|4 -
 fs/ext3/super.c  |4 -
 fs/ext4/super.c  |4 -
 fs/gfs2/ops_fstype.c |2 
 fs/inotify_user.c|4 -
 fs/namei.c   |   56 ++-
 fs/namespace.c   |   20 -
 fs/nfs/namespace.c   |2 
 fs/nfsctl.c  |2 
 fs/nfsd/export.c |   10 ++--
 fs/nfsd/nfs4recover.c|2 
 fs/nfsd/nfs4state.c  |2 
 fs/open.c|   22 +-
 fs/proc/base.c   |2 
 fs/reiserfs/super.c  |8 +--
 fs/revoke.c  |2 
 fs/stat.c|6 +-
 fs/unionfs/main.c|2 
 fs/unionfs/super.c   |   12 ++---
 fs/utimes.c  |2 
 fs/xattr.c   |   16 +++
 fs/xfs/linux-2.6/xfs_ioctl.c |2 
 include/linux/namei.h|7 ---
 include/linux/path.h |2 
 kernel/audit_tree.c  |   16 +++
 kernel/auditfilter.c |4 -
 net/sunrpc/rpc_pipe.c|2 
 net/unix/af_unix.c   |6 +-
 43 files changed, 134 insertions(+), 133 deletions(-)

--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -261,7 +261,7 @@ osf_statfs(char __user *path, struct osf
retval = user_path_walk(path, );
if (!retval) {
retval = do_osf_statfs(nd.path.dentry, buffer, bufsiz);
-   path_release();
+   path_put();
}
return retval;
 }
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -711,7 +711,7 @@ asmlinkage int irix_statfs(const char __
}
 
 dput_and_out:
-   path_release();
+   path_put();
 out:
return error;
 }
@@ -1385,7 +1385,7 @@ asmlinkage int irix_statvfs(char __user 
error |= __put_user(0, >f_fstr[i]);
 
 dput_and_out:
-   path_release();
+   path_put();
 out:
return error;
 }
@@ -1636,7 +1636,7 @@ asmlinkage int irix_statvfs64(char __use
error |= __put_user(0, >f_fstr[i]);
 
 dput_and_out:
-   path_release();
+   path_put();
 out:
return error;
 }
--- a/arch/parisc/hpux/sys_hpux.c
+++ b/arch/parisc/hpux/sys_hpux.c
@@ -222,7 +222,7 @@ asmlinkage long hpux_statfs(const char _
error = vfs_statfs_hpux(nd.path.dentry, );
if (!error && copy_to_user(buf, , sizeof(tmp)))
error = -EFAULT;
-   path_release();
+   path_put();
}
return error;
 }
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -73,7 +73,7 @@ static long do_spu_create(const char __u
LOOKUP_OPEN|LOOKUP_CREATE, );
if (!ret) {
ret = spufs_create(, flags, mode, neighbor);
-   path_release();
+   path_put();
}
putname(tmp);
}
--- a/arch/sparc64/solaris/fs.c
+++ b/arch/sparc64/solaris/fs.c
@@ -436,7 +436,7 @@ asmlinkage int solaris_statvfs(u32 path,
if (!error) {
struct inode *inode = nd.path.dentry->d_inode;
error = report_statvfs(nd.path.mnt, inode, 

[PATCH 06/13] Introduce path_put()

2007-10-22 Thread Bharata B Rao
From: Jan Blunck [EMAIL PROTECTED]

* Add path_put() functions for releasing a reference to the dentry and
  vfsmount of a struct path in the right order

* Switch from path_release(nd) to path_put(nd-path)

* Rename dput_path() to path_put_conditional()

Signed-off-by: Jan Blunck [EMAIL PROTECTED]
Signed-off-by: Andreas Gruenbacher [EMAIL PROTECTED]
Signed-off-by: Bharata B Rao [EMAIL PROTECTED]
---
 arch/alpha/kernel/osf_sys.c  |2 
 arch/mips/kernel/sysirix.c   |6 +-
 arch/parisc/hpux/sys_hpux.c  |2 
 arch/powerpc/platforms/cell/spufs/syscalls.c |2 
 arch/sparc64/solaris/fs.c|4 -
 drivers/md/dm-table.c|2 
 drivers/mtd/mtdsuper.c   |4 -
 fs/afs/mntpt.c   |2 
 fs/autofs4/root.c|2 
 fs/block_dev.c   |2 
 fs/coda/pioctl.c |4 -
 fs/compat.c  |4 -
 fs/configfs/symlink.c|4 -
 fs/dquot.c   |2 
 fs/ecryptfs/main.c   |2 
 fs/exec.c|4 -
 fs/ext3/super.c  |4 -
 fs/ext4/super.c  |4 -
 fs/gfs2/ops_fstype.c |2 
 fs/inotify_user.c|4 -
 fs/namei.c   |   56 ++-
 fs/namespace.c   |   20 -
 fs/nfs/namespace.c   |2 
 fs/nfsctl.c  |2 
 fs/nfsd/export.c |   10 ++--
 fs/nfsd/nfs4recover.c|2 
 fs/nfsd/nfs4state.c  |2 
 fs/open.c|   22 +-
 fs/proc/base.c   |2 
 fs/reiserfs/super.c  |8 +--
 fs/revoke.c  |2 
 fs/stat.c|6 +-
 fs/unionfs/main.c|2 
 fs/unionfs/super.c   |   12 ++---
 fs/utimes.c  |2 
 fs/xattr.c   |   16 +++
 fs/xfs/linux-2.6/xfs_ioctl.c |2 
 include/linux/namei.h|7 ---
 include/linux/path.h |2 
 kernel/audit_tree.c  |   16 +++
 kernel/auditfilter.c |4 -
 net/sunrpc/rpc_pipe.c|2 
 net/unix/af_unix.c   |6 +-
 43 files changed, 134 insertions(+), 133 deletions(-)

--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -261,7 +261,7 @@ osf_statfs(char __user *path, struct osf
retval = user_path_walk(path, nd);
if (!retval) {
retval = do_osf_statfs(nd.path.dentry, buffer, bufsiz);
-   path_release(nd);
+   path_put(nd.path);
}
return retval;
 }
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -711,7 +711,7 @@ asmlinkage int irix_statfs(const char __
}
 
 dput_and_out:
-   path_release(nd);
+   path_put(nd.path);
 out:
return error;
 }
@@ -1385,7 +1385,7 @@ asmlinkage int irix_statvfs(char __user 
error |= __put_user(0, buf-f_fstr[i]);
 
 dput_and_out:
-   path_release(nd);
+   path_put(nd.path);
 out:
return error;
 }
@@ -1636,7 +1636,7 @@ asmlinkage int irix_statvfs64(char __use
error |= __put_user(0, buf-f_fstr[i]);
 
 dput_and_out:
-   path_release(nd);
+   path_put(nd.path);
 out:
return error;
 }
--- a/arch/parisc/hpux/sys_hpux.c
+++ b/arch/parisc/hpux/sys_hpux.c
@@ -222,7 +222,7 @@ asmlinkage long hpux_statfs(const char _
error = vfs_statfs_hpux(nd.path.dentry, tmp);
if (!error  copy_to_user(buf, tmp, sizeof(tmp)))
error = -EFAULT;
-   path_release(nd);
+   path_put(nd.path);
}
return error;
 }
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -73,7 +73,7 @@ static long do_spu_create(const char __u
LOOKUP_OPEN|LOOKUP_CREATE, nd);
if (!ret) {
ret = spufs_create(nd, flags, mode, neighbor);
-   path_release(nd);
+   path_put(nd.path);
}
putname(tmp);
}
--- a/arch/sparc64/solaris/fs.c
+++ b/arch/sparc64/solaris/fs.c
@@ -436,7 +436,7 @@ asmlinkage int solaris_statvfs(u32 path,
if (!error) {
struct inode *inode = nd.path.dentry-d_inode;