Commit 061afd80 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[PATCH] remove lock_kernel() from inode_setattr's

vmtruncate() does not need lock_kernel().  And lock_kernel() is not taken by
other vmtruncate() callers.
parent 7018133c
......@@ -68,17 +68,11 @@ 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)
if (error || (ia_valid == ATTR_SIZE))
goto out;
}
}
lock_kernel();
if (ia_valid & ATTR_UID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment