On Mon 09-10-17 14:29:09, Tejun Heo wrote: > Currently, filesystem can indiate cgroup writeback support per > superblock; however, depending on the filesystem, especially if inodes > are used to carry metadata, it can be useful to indicate cgroup > writeback support per inode. > > This patch replaces the superblock flag SB_I_CGROUPWB with per-inode > S_CGROUPWB, so that cgroup writeback can be enabled selectively. > > * block_dev sets the new flag in bdget() when initializing new inode. > > * ext2/4 set the new flag in ext?_set_inode_flags() function. > > * btrfs sets the new flag in btrfs_update_iflags() function. Note > that this automatically excludes btree_inode which doesn't use > btrfs_update_iflags() during initialization. This is an intended > behavior change. > > Signed-off-by: Tejun Heo <[email protected]> > Cc: Jan Kara <[email protected]> > Cc: Jens Axboe <[email protected]> > Cc: Chris Mason <[email protected]> > Cc: Josef Bacik <[email protected]> > Cc: [email protected] > Cc: "Theodore Ts'o" <[email protected]> > Cc: Andreas Dilger <[email protected]> > Cc: [email protected]
... > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 31db875..344f12b 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -4591,8 +4591,11 @@ void ext4_set_inode_flags(struct inode *inode) > !ext4_should_journal_data(inode) && !ext4_has_inline_data(inode) && > !ext4_encrypted_inode(inode)) > new_fl |= S_DAX; > + if (test_opt(inode->i_sb, DATA_FLAGS) != EXT4_MOUNT_JOURNAL_DATA) > + new_fl |= S_CGROUPWB; Use ext4_should_journal_data(inode) here? Ext4 can be journalling data also because of per-inode flag. Otherwise the patch looks good. You can add: Reviewed-by: Jan Kara <[email protected]> Honza -- Jan Kara <[email protected]> SUSE Labs, CR

