]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
cifs: truncate fallout
authorChristoph Hellwig <hch@infradead.org>
Sun, 18 Jul 2010 21:51:21 +0000 (17:51 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Aug 2010 20:48:48 +0000 (16:48 -0400)
commit1b9474635e21eef0f3e69fd1c7b1b9598ffdddd3
tree89c63dc57f7c197a8f48633c5e05d9c1f3b87679
parente566d48c9bd56f57e25e855a21e06ca2c2525795
cifs: truncate fallout

Remove the calls to inode_newsize_ok given that we already did it as
part of inode_change_ok in the beginning of cifs_setattr_(no)unix.

No need to call ->truncate if cifs doesn't have one, so remove the
explicit call in cifs_vmtruncate, and replace the calls to vmtruncate
with truncate_setsize which is vmtruncate minus inode_newsize_ok
and the call to ->truncate.

Rename cifs_vmtruncate to cifs_setsize to match the new calling conventions.

Question 1:  why does cifs do the pagecache munging and i_size update twice
for each setattr call, once opencoded in cifs_vmtruncate, and once
using the VFS helpers?
Question 2: what is supposed to be protected by i_lock in cifs_vmtruncate?
Do we need it around the call to inode_change_ok?

[AV: fixed build breakage]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/inode.c