diff options
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c index ed35383d0b6c..b48324a94c2b 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1243,6 +1243,23 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry) | |||
1243 | EXPORT_SYMBOL(touch_atime); | 1243 | EXPORT_SYMBOL(touch_atime); |
1244 | 1244 | ||
1245 | /** | 1245 | /** |
1246 | * inode_inc_iversion - increments i_version | ||
1247 | * @inode: inode that need to be updated | ||
1248 | * | ||
1249 | * Every time the inode is modified, the i_version field | ||
1250 | * will be incremented. | ||
1251 | * The filesystem has to be mounted with i_version flag | ||
1252 | * | ||
1253 | */ | ||
1254 | |||
1255 | void inode_inc_iversion(struct inode *inode) | ||
1256 | { | ||
1257 | spin_lock(&inode->i_lock); | ||
1258 | inode->i_version++; | ||
1259 | spin_unlock(&inode->i_lock); | ||
1260 | } | ||
1261 | |||
1262 | /** | ||
1246 | * file_update_time - update mtime and ctime time | 1263 | * file_update_time - update mtime and ctime time |
1247 | * @file: file accessed | 1264 | * @file: file accessed |
1248 | * | 1265 | * |
@@ -1276,6 +1293,11 @@ void file_update_time(struct file *file) | |||
1276 | sync_it = 1; | 1293 | sync_it = 1; |
1277 | } | 1294 | } |
1278 | 1295 | ||
1296 | if (IS_I_VERSION(inode)) { | ||
1297 | inode_inc_iversion(inode); | ||
1298 | sync_it = 1; | ||
1299 | } | ||
1300 | |||
1279 | if (sync_it) | 1301 | if (sync_it) |
1280 | mark_inode_dirty_sync(inode); | 1302 | mark_inode_dirty_sync(inode); |
1281 | } | 1303 | } |