Lines Matching defs:inode
45 static int ext4_sync_parent(struct inode *inode)
50 if (!ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY))
52 dentry = d_find_any_alias(inode);
55 while (ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY)) {
56 ext4_clear_inode_state(inode, EXT4_STATE_NEWENTRY);
61 inode = dentry->d_inode;
64 * The directory inode may have gone through rmdir by now. But
65 * the inode itself and its blocks are still allocated (we hold
66 * a reference to the inode via its dentry), so it didn't go
68 * metadata blocks and the inode.
70 ret = sync_mapping_buffers(inode->i_mapping);
73 ret = sync_inode_metadata(inode, 1);
81 static int ext4_fsync_nojournal(struct inode *inode, bool datasync,
86 ret = sync_mapping_buffers(inode->i_mapping);
87 if (!(inode->i_state & I_DIRTY_ALL))
89 if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
92 err = sync_inode_metadata(inode, 1);
97 ret = ext4_sync_parent(inode);
98 if (test_opt(inode->i_sb, BARRIER))
104 static int ext4_fsync_journal(struct inode *inode, bool datasync,
107 struct ext4_inode_info *ei = EXT4_I(inode);
108 journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
123 * Another task could have dirtied this inode. Its data can be in any
127 * inode to disk.
133 struct inode *inode = file->f_mapping->host;
134 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
143 if (sb_rdonly(inode->i_sb)) {
146 if (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FS_ABORTED))
170 ret = ext4_fsync_nojournal(inode, datasync, &needs_barrier);
171 else if (ext4_should_journal_data(inode))
172 ret = ext4_force_commit(inode->i_sb);
174 ret = ext4_fsync_journal(inode, datasync, &needs_barrier);
177 err = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL);
185 trace_ext4_sync_file_exit(inode, ret);