ext4: Wait for proper transaction commit on fsync
[linux-2.6-block.git] / fs / ext4 / ext4_jbd2.h
index 2c2b262bd31ba6eb591d137c073f7017ec7ebb14..05eca817d7046258f54d3a8715dafb946ff5e155 100644 (file)
@@ -249,6 +249,19 @@ static inline int ext4_jbd2_file_inode(handle_t *handle, struct inode *inode)
        return 0;
 }
 
+static inline void ext4_update_inode_fsync_trans(handle_t *handle,
+                                                struct inode *inode,
+                                                int datasync)
+{
+       struct ext4_inode_info *ei = EXT4_I(inode);
+
+       if (ext4_handle_valid(handle)) {
+               ei->i_sync_tid = handle->h_transaction->t_tid;
+               if (datasync)
+                       ei->i_datasync_tid = handle->h_transaction->t_tid;
+       }
+}
+
 /* super.c */
 int ext4_force_commit(struct super_block *sb);