]> err.no Git - linux-2.6/blobdiff - fs/inode.c
vfs: Add 64 bit i_version support
[linux-2.6] / fs / inode.c
index ed35383d0b6c4f9b53fcc536da045cacfaf6c123..b48324a94c2b55ad88e15a46aeb9d38fdd8c7d16 100644 (file)
@@ -1242,6 +1242,23 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
 }
 EXPORT_SYMBOL(touch_atime);
 
+/**
+ *     inode_inc_iversion      -       increments i_version
+ *     @inode: inode that need to be updated
+ *
+ *     Every time the inode is modified, the i_version field
+ *     will be incremented.
+ *     The filesystem has to be mounted with i_version flag
+ *
+ */
+
+void inode_inc_iversion(struct inode *inode)
+{
+       spin_lock(&inode->i_lock);
+       inode->i_version++;
+       spin_unlock(&inode->i_lock);
+}
+
 /**
  *     file_update_time        -       update mtime and ctime time
  *     @file: file accessed
@@ -1276,6 +1293,11 @@ void file_update_time(struct file *file)
                sync_it = 1;
        }
 
+       if (IS_I_VERSION(inode)) {
+               inode_inc_iversion(inode);
+               sync_it = 1;
+       }
+
        if (sync_it)
                mark_inode_dirty_sync(inode);
 }