diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2007-05-08 03:24:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:00 -0400 |
commit | fe08a9d4982d9618ec25760ea715c46fe051e508 (patch) | |
tree | 6535cfaf206d19cb0a5e09192f49b37e91ba6232 | |
parent | 6f2fad748ccced5b9313efce2a2c7ae4c04ef564 (diff) |
reiserfs: shrink superblock if no xattrs
This makes in-core superblock fit into one cacheline here.
Before:
struct dentry * xattr_root; /* 124 4 */
/* --- cacheline 1 boundary (128 bytes) --- */
struct rw_semaphore xattr_dir_sem; /* 128 12 */
int j_errno; /* 140 4 */
}; /* size: 144, cachelines: 2 */
/* sum members: 142, holes: 1, sum holes: 2 */
/* last cacheline: 16 bytes */
After:
int j_errno; /* 124 4 */
/* --- cacheline 1 boundary (128 bytes) --- */
}; /* size: 128, cachelines: 1 */
/* sum members: 126, holes: 1, sum holes: 2 */
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/reiserfs/super.c | 6 | ||||
-rw-r--r-- | include/linux/reiserfs_fs_sb.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 7054aaef0493..5c58b419f4ee 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -433,12 +433,13 @@ int remove_save_link(struct inode *inode, int truncate) | |||
433 | static void reiserfs_kill_sb(struct super_block *s) | 433 | static void reiserfs_kill_sb(struct super_block *s) |
434 | { | 434 | { |
435 | if (REISERFS_SB(s)) { | 435 | if (REISERFS_SB(s)) { |
436 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
436 | if (REISERFS_SB(s)->xattr_root) { | 437 | if (REISERFS_SB(s)->xattr_root) { |
437 | d_invalidate(REISERFS_SB(s)->xattr_root); | 438 | d_invalidate(REISERFS_SB(s)->xattr_root); |
438 | dput(REISERFS_SB(s)->xattr_root); | 439 | dput(REISERFS_SB(s)->xattr_root); |
439 | REISERFS_SB(s)->xattr_root = NULL; | 440 | REISERFS_SB(s)->xattr_root = NULL; |
440 | } | 441 | } |
441 | 442 | #endif | |
442 | if (REISERFS_SB(s)->priv_root) { | 443 | if (REISERFS_SB(s)->priv_root) { |
443 | d_invalidate(REISERFS_SB(s)->priv_root); | 444 | d_invalidate(REISERFS_SB(s)->priv_root); |
444 | dput(REISERFS_SB(s)->priv_root); | 445 | dput(REISERFS_SB(s)->priv_root); |
@@ -1562,9 +1563,10 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1562 | REISERFS_SB(s)->s_alloc_options.preallocmin = 0; | 1563 | REISERFS_SB(s)->s_alloc_options.preallocmin = 0; |
1563 | /* Preallocate by 16 blocks (17-1) at once */ | 1564 | /* Preallocate by 16 blocks (17-1) at once */ |
1564 | REISERFS_SB(s)->s_alloc_options.preallocsize = 17; | 1565 | REISERFS_SB(s)->s_alloc_options.preallocsize = 17; |
1566 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
1565 | /* Initialize the rwsem for xattr dir */ | 1567 | /* Initialize the rwsem for xattr dir */ |
1566 | init_rwsem(&REISERFS_SB(s)->xattr_dir_sem); | 1568 | init_rwsem(&REISERFS_SB(s)->xattr_dir_sem); |
1567 | 1569 | #endif | |
1568 | /* setup default block allocator options */ | 1570 | /* setup default block allocator options */ |
1569 | reiserfs_init_alloc_options(s); | 1571 | reiserfs_init_alloc_options(s); |
1570 | 1572 | ||
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 3a28742d86f9..1e5488ede037 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -401,9 +401,10 @@ struct reiserfs_sb_info { | |||
401 | int reserved_blocks; /* amount of blocks reserved for further allocations */ | 401 | int reserved_blocks; /* amount of blocks reserved for further allocations */ |
402 | spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ | 402 | spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ |
403 | struct dentry *priv_root; /* root of /.reiserfs_priv */ | 403 | struct dentry *priv_root; /* root of /.reiserfs_priv */ |
404 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
404 | struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ | 405 | struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ |
405 | struct rw_semaphore xattr_dir_sem; | 406 | struct rw_semaphore xattr_dir_sem; |
406 | 407 | #endif | |
407 | int j_errno; | 408 | int j_errno; |
408 | #ifdef CONFIG_QUOTA | 409 | #ifdef CONFIG_QUOTA |
409 | char *s_qf_names[MAXQUOTAS]; | 410 | char *s_qf_names[MAXQUOTAS]; |