]> git.hungrycats.org Git - linux/commitdiff
[PATCH] remove lock_kernel() from inode_setattr's
authorAndrew Morton <akpm@digeo.com>
Sat, 22 Mar 2003 15:33:27 +0000 (07:33 -0800)
committerDavid S. Miller <davem@kernel.bkbits.net>
Sat, 22 Mar 2003 15:33:27 +0000 (07:33 -0800)
vmtruncate() does not need lock_kernel().  And lock_kernel() is not taken by
other vmtruncate() callers.

fs/attr.c

index 9e50409b3b1679f6d2903b33e89857362b7232e1..dd2f402a6fac979db007b8fd1f93350f8f1b31a3 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -68,16 +68,10 @@ int inode_setattr(struct inode * inode, struct iattr * attr)
        int error = 0;
 
        if (ia_valid & ATTR_SIZE) {
-               if (attr->ia_size == inode->i_size) {
-                       if (ia_valid == ATTR_SIZE)
-                               goto out;       /* we can skip lock_kernel() */
-               } else {
-                       lock_kernel();
+               if (attr->ia_size != inode->i_size)
                        error = vmtruncate(inode, attr->ia_size);
-                       unlock_kernel();
-                       if (error)
-                               goto out;
-               }
+               if (error || (ia_valid == ATTR_SIZE))
+                       goto out;
        }
 
        lock_kernel();