diff options
author | Josef Bacik <josef@redhat.com> | 2012-03-26 09:59:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:07:25 -0400 |
commit | c3b2da314834499f34cba94f7053e55f6d6f92d8 (patch) | |
tree | 7012b569ee9e0781761a8eb388190979441583c7 /fs/splice.c | |
parent | 033369d1af1264abc23bea2e174aa47cdd212f6f (diff) | |
download | lwn-c3b2da314834499f34cba94f7053e55f6d6f92d8.tar.gz lwn-c3b2da314834499f34cba94f7053e55f6d6f92d8.zip |
fs: introduce inode operation ->update_time
Btrfs has to make sure we have space to allocate new blocks in order to modify
the inode, so updating time can fail. We've gotten around this by having our
own file_update_time but this is kind of a pain, and Christoph has indicated he
would like to make xfs do something different with atime updates. So introduce
->update_time, where we will deal with i_version an a/m/c time updates and
indicate which changes need to be made. The normal version just does what it
has always done, updates the time and marks the inode dirty, and then
filesystems can choose to do something different.
I've gone through all of the users of file_update_time and made them check for
errors with the exception of the fault code since it's complicated and I wasn't
quite sure what to do there, also Jan is going to be pushing the file time
updates into page_mkwrite for those who have it so that should satisfy btrfs and
make it not a big deal to check the file_update_time() return code in the
generic fault path. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c index f8476841eb04..47c4c1ad0c04 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1003,8 +1003,10 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD); ret = file_remove_suid(out); if (!ret) { - file_update_time(out); - ret = splice_from_pipe_feed(pipe, &sd, pipe_to_file); + ret = file_update_time(out); + if (!ret) + ret = splice_from_pipe_feed(pipe, &sd, + pipe_to_file); } mutex_unlock(&inode->i_mutex); } while (ret > 0); |