Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3449b237 authored by Tejun Heo's avatar Tejun Heo Committed by Gerrit - the friendly Code Review server
Browse files

vfs, writeback: replace FS_CGROUP_WRITEBACK with SB_I_CGROUPWB



FS_CGROUP_WRITEBACK indicates whether a file_system_type supports
cgroup writeback; however, different super_blocks of the same
file_system_type may or may not support cgroup writeback depending on
filesystem options.  This patch replaces FS_CGROUP_WRITEBACK with a
per-super_block flag.

super_block->s_flags carries some internal flags in the high bits but
it's exposd to userland through uapi header and running out of space
anyway.  This patch adds a new field super_block->s_iflags to carry
kernel-internal flags.  It is currently only used by the new
SB_I_CGROUPWB flag whose concatenated and abbreviated name is for
consistency with other super_block flags.

ext2_fill_super() is updated to set SB_I_CGROUPWB.

v2: Added super_block->s_iflags instead of stealing another high bit
    from sb->s_flags as suggested by Christoph and Jan.

Change-Id: I62a6811d3118901f9ad14cee12dc156d376e56c5
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Git-commit: 46b15caa7cb19b0f6e3bc8ebaee5bc1bb2e35110
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


[kkr@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: default avatarKrishnamurthy K R <kkr@codeaurora.org>
parent c4ef45db
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -867,6 +867,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
		((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ?
		 MS_POSIXACL : 0);
	sb->s_iflags |= SB_I_CGROUPWB;

	ext2_xip_verify_sb(sb); /* see if bdev supports xip, unset
				    EXT2_MOUNT_XIP if not */
+3 −0
Original line number Diff line number Diff line
@@ -1143,6 +1143,8 @@ static inline int lease_modify(struct file_lock **before, int arg,
}
#endif /* !CONFIG_FILE_LOCKING */

/* sb->s_iflags */
#define SB_I_CGROUPWB	0x00000001	/* cgroup-aware writeback enabled */

struct fasync_struct {
	spinlock_t		fa_lock;
@@ -1223,6 +1225,7 @@ struct super_block {
	const struct quotactl_ops	*s_qcop;
	const struct export_operations *s_export_op;
	unsigned long		s_flags;
	unsigned long		s_iflags;	/* internal SB_I_* flags */
	unsigned long		s_magic;
	struct dentry		*s_root;
	struct rw_semaphore	s_umount;