aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-03-26 09:59:21 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 12:07:25 -0400
commitc3b2da314834499f34cba94f7053e55f6d6f92d8 (patch)
tree7012b569ee9e0781761a8eb388190979441583c7 /Documentation/filesystems
parent033369d1af1264abc23bea2e174aa47cdd212f6f (diff)
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 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/Locking3
-rw-r--r--Documentation/filesystems/vfs.txt4
2 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 4fca82e5276e..d5a269a51a9e 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -62,6 +62,7 @@ ata *);
62 int (*removexattr) (struct dentry *, const char *); 62 int (*removexattr) (struct dentry *, const char *);
63 void (*truncate_range)(struct inode *, loff_t, loff_t); 63 void (*truncate_range)(struct inode *, loff_t, loff_t);
64 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); 64 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
65 void (*update_time)(struct inode *, struct timespec *, int);
65 66
66locking rules: 67locking rules:
67 all may block 68 all may block
@@ -89,6 +90,8 @@ listxattr: no
89removexattr: yes 90removexattr: yes
90truncate_range: yes 91truncate_range: yes
91fiemap: no 92fiemap: no
93update_time: no
94
92 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on 95 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
93victim. 96victim.
94 cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem. 97 cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 0d0492028082..b2aa722e5ea2 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -364,6 +364,7 @@ struct inode_operations {
364 ssize_t (*listxattr) (struct dentry *, char *, size_t); 364 ssize_t (*listxattr) (struct dentry *, char *, size_t);
365 int (*removexattr) (struct dentry *, const char *); 365 int (*removexattr) (struct dentry *, const char *);
366 void (*truncate_range)(struct inode *, loff_t, loff_t); 366 void (*truncate_range)(struct inode *, loff_t, loff_t);
367 void (*update_time)(struct inode *, struct timespec *, int);
367}; 368};
368 369
369Again, all methods are called without any locks being held, unless 370Again, all methods are called without any locks being held, unless
@@ -475,6 +476,9 @@ otherwise noted.
475 truncate_range: a method provided by the underlying filesystem to truncate a 476 truncate_range: a method provided by the underlying filesystem to truncate a
476 range of blocks , i.e. punch a hole somewhere in a file. 477 range of blocks , i.e. punch a hole somewhere in a file.
477 478
479 update_time: called by the VFS to update a specific time or the i_version of
480 an inode. If this is not defined the VFS will update the inode itself
481 and call mark_inode_dirty_sync.
478 482
479The Address Space Object 483The Address Space Object
480======================== 484========================