Skip to content

Commit e4c570c

Browse files
h-shimamototorvalds
authored andcommitted
task_struct: make journal_info conditional
journal_info in task_struct is used in journaling file system only. So introduce CONFIG_FS_JOURNAL_INFO and make it conditional. Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Cc: Chris Mason <chris.mason@oracle.com> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8420e7e commit e4c570c

10 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎fs/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ menu "File systems"
66

77
if BLOCK
88

9+
config FS_JOURNAL_INFO
10+
bool
11+
default n
12+
913
source "fs/ext2/Kconfig"
1014
source "fs/ext3/Kconfig"
1115
source "fs/ext4/Kconfig"

‎fs/btrfs/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config BTRFS_FS
44
select LIBCRC32C
55
select ZLIB_INFLATE
66
select ZLIB_DEFLATE
7+
select FS_JOURNAL_INFO
78
help
89
Btrfs is a new filesystem with extents, writable snapshotting,
910
support for multiple devices and many more features.

‎fs/ext4/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ config EXT4_FS
22
tristate "The Extended 4 (ext4) filesystem"
33
select JBD2
44
select CRC16
5+
select FS_JOURNAL_INFO
56
help
67
This is the next generation of the ext3 filesystem.
78

‎fs/gfs2/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config GFS2_FS
1010
select SLOW_WORK
1111
select QUOTA
1212
select QUOTACTL
13+
select FS_JOURNAL_INFO
1314
help
1415
A cluster filesystem.
1516

‎fs/jbd/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config JBD
22
tristate
3+
select FS_JOURNAL_INFO
34
help
45
This is a generic journalling layer for block devices. It is
56
currently used by the ext3 file system, but it could also be

‎fs/jbd2/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config JBD2
22
tristate
33
select CRC32
4+
select FS_JOURNAL_INFO
45
help
56
This is a generic journaling layer for block devices that support
67
both 32-bit and 64-bit block numbers. It is currently used by

‎fs/nilfs2/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ config NILFS2_FS
22
tristate "NILFS2 file system support (EXPERIMENTAL)"
33
depends on EXPERIMENTAL
44
select CRC32
5+
select FS_JOURNAL_INFO
56
help
67
NILFS2 is a log-structured file system (LFS) supporting continuous
78
snapshotting. In addition to versioning capability of the entire

‎fs/reiserfs/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config REISERFS_FS
22
tristate "Reiserfs support"
33
select CRC32
4+
select FS_JOURNAL_INFO
45
help
56
Stores not just filenames but the files themselves in a balanced
67
tree. Uses journalling.

‎include/linux/init_task.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ extern struct cred init_cred;
111111
# define INIT_PERF_EVENTS(tsk)
112112
#endif
113113

114+
#ifdef CONFIG_FS_JOURNAL_INFO
115+
#define INIT_JOURNAL_INFO .journal_info = NULL,
116+
#else
117+
#define INIT_JOURNAL_INFO
118+
#endif
119+
114120
/*
115121
* INIT_TASK is used to set up the first task table, touch at
116122
* your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -162,7 +168,6 @@ extern struct cred init_cred;
162168
.signal = {{0}}}, \
163169
.blocked = {{0}}, \
164170
.alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
165-
.journal_info = NULL, \
166171
.cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
167172
.fs_excl = ATOMIC_INIT(0), \
168173
.pi_lock = __SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
@@ -173,6 +178,7 @@ extern struct cred init_cred;
173178
[PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
174179
}, \
175180
.dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
181+
INIT_JOURNAL_INFO \
176182
INIT_IDS \
177183
INIT_PERF_EVENTS(tsk) \
178184
INIT_TRACE_IRQFLAGS \

‎include/linux/sched.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,8 +1446,10 @@ struct task_struct {
14461446
gfp_t lockdep_reclaim_gfp;
14471447
#endif
14481448

1449+
#ifdef CONFIG_FS_JOURNAL_INFO
14491450
/* journalling filesystem info */
14501451
void *journal_info;
1452+
#endif
14511453

14521454
/* stacked block device info */
14531455
struct bio *bio_list, **bio_tail;

0 commit comments

Comments
 (0)