aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-03-26 09:59:21 -0400
committerZiyan <jaraidaniel@gmail.com>2016-04-03 14:55:52 +0200
commitd850b9a178a8d6aba2bc0efd09bd9b9a173b277e (patch)
tree2de3051377075c97db0b4233cf65a2f5451f9d4f /mm
parentbc9600bb91c52252e67c163606ca57fbf0c369b3 (diff)
downloadkernel_samsung_tuna-d850b9a178a8d6aba2bc0efd09bd9b9a173b277e.tar.gz
kernel_samsung_tuna-d850b9a178a8d6aba2bc0efd09bd9b9a173b277e.tar.bz2
kernel_samsung_tuna-d850b9a178a8d6aba2bc0efd09bd9b9a173b277e.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> (cherry picked from commit c3b2da314834499f34cba94f7053e55f6d6f92d8) Conflicts: fs/inode.c
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c4
-rw-r--r--mm/filemap_xip.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 0942a70c13f..bafbb2c457b 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2508,7 +2508,9 @@ ssize_t __generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
if (err)
goto out;
- file_update_time(file);
+ err = file_update_time(file);
+ if (err)
+ goto out;
/* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
if (unlikely(file->f_flags & O_DIRECT)) {
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
index dee94297f39..0534184ecd4 100644
--- a/mm/filemap_xip.c
+++ b/mm/filemap_xip.c
@@ -426,7 +426,9 @@ xip_file_write(struct file *filp, const char __user *buf, size_t len,
if (ret)
goto out_backing;
- file_update_time(filp);
+ ret = file_update_time(filp);
+ if (ret)
+ goto out_backing;
ret = __xip_file_write (filp, buf, count, pos, ppos);