The patch titled

     use get_fs_struct() in proc

has been added to the -mm tree.  Its filename is

     use-get_fs_struct-in-proc.patch

Patches currently in -mm which might be from [EMAIL PROTECTED] are

proc-link-count-fix.patch
remove-ia_attr_flags.patch
namei-cleanup.patch
use-get_fs_struct-in-proc.patch
fix-enum-pid_directory_inos-in-proc-basec.patch
remove-duplicated-code-from-proc-and-ptrace.patch
remove-duplicated-sys_open32-code-from-64bit-archs.patch
cifs_create-fix.patch
deprecate-openfoo-3.patch
pivot_root-circular-reference-fix-3.patch
fuse-maintainers-kconfig-and-makefile-changes.patch
fuse-core.patch
fuse-device-functions.patch
fuse-device-functions-document-mount-options.patch
fuse-device-functions-document-mount-options-documentation-update.patch
fuse-device-functions-request-counter-overflow-fix.patch
fuse-device-functions-module-alias.patch
fuse-read-only-operations.patch
fuse-read-only-operations-follow_link-fix.patch
fuse-read-write-operations.patch
fuse-file-operations.patch
fuse-mount-options.patch
fuse-extended-attribute-operations.patch
fuse-add-padding.patch
fuse-readpages-operation.patch
fuse-tighten-check-for-processes-allowed-access.patch
fuse-stricter-mount-option-checking.patch
fuse-direct-i-o.patch
fuse-direct-i-o-cleanup.patch
fuse-transfer-readdir-data-through-device.patch
fuse-dont-update-file-times.patch
fuse-add-fsync-operation-for-directories.patch
fuse-dont-allow-restarting-of-system-calls.patch



From: Miklos Szeredi <[EMAIL PROTECTED]>

This patch cleans up proc_cwd_link() and proc_root_link() by factoring
out common code into get_fs_struct().

Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Cc: Christoph Hellwig <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 fs/proc/base.c |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff -puN fs/proc/base.c~use-get_fs_struct-in-proc fs/proc/base.c
--- 25/fs/proc/base.c~use-get_fs_struct-in-proc Mon Aug 29 14:23:35 2005
+++ 25-akpm/fs/proc/base.c      Mon Aug 29 14:23:35 2005
@@ -297,15 +297,21 @@ static int proc_fd_link(struct inode *in
        return -ENOENT;
 }
 
-static int proc_cwd_link(struct inode *inode, struct dentry **dentry, struct 
vfsmount **mnt)
+static struct fs_struct *get_fs_struct(struct task_struct *task)
 {
        struct fs_struct *fs;
-       int result = -ENOENT;
-       task_lock(proc_task(inode));
-       fs = proc_task(inode)->fs;
+       task_lock(task);
+       fs = task->fs;
        if(fs)
                atomic_inc(&fs->count);
-       task_unlock(proc_task(inode));
+       task_unlock(task);
+       return fs;
+}
+
+static int proc_cwd_link(struct inode *inode, struct dentry **dentry, struct 
vfsmount **mnt)
+{
+       struct fs_struct *fs = get_fs_struct(proc_task(inode));
+       int result = -ENOENT;
        if (fs) {
                read_lock(&fs->lock);
                *mnt = mntget(fs->pwdmnt);
@@ -319,13 +325,8 @@ static int proc_cwd_link(struct inode *i
 
 static int proc_root_link(struct inode *inode, struct dentry **dentry, struct 
vfsmount **mnt)
 {
-       struct fs_struct *fs;
+       struct fs_struct *fs = get_fs_struct(proc_task(inode));
        int result = -ENOENT;
-       task_lock(proc_task(inode));
-       fs = proc_task(inode)->fs;
-       if(fs)
-               atomic_inc(&fs->count);
-       task_unlock(proc_task(inode));
        if (fs) {
                read_lock(&fs->lock);
                *mnt = mntget(fs->rootmnt);
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to