From 061afd80999eb873179fe7af391ba26a6000765b Mon Sep 17 00:00:00 2001 From: Andrew Morton <akpm@digeo.com> Date: Sat, 22 Mar 2003 07:33:27 -0800 Subject: [PATCH] [PATCH] remove lock_kernel() from inode_setattr's vmtruncate() does not need lock_kernel(). And lock_kernel() is not taken by other vmtruncate() callers. --- fs/attr.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index 9e50409b3b16..dd2f402a6fac 100644 --- 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(); -- 2.30.9