aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2006-12-06 23:38:53 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:41 -0500
commit83b7b44e1c1e9e493ccd4146558481ab5af0116a (patch)
tree8da0b4d9601d27073b14964fd43f64bb73540e22 /include/linux/fs.h
parentea82c74093f48b28e632d03eeff22faf99727a8c (diff)
[PATCH] fs: reorder some 'struct inode' fields to speedup i_size manipulations
On 32bits SMP platforms, 64bits i_size is protected by a seqcount (i_size_seqcount). When i_size is read or written, i_size_seqcount is read/written as well, so it make sense to group these two fields together in the same cache line. This patch moves i_size_seqcount next to i_size, and also moves i_version to let offsetof(struct inode, i_size) being 0x40 instead of 0x3c (for 32bits platforms). For 64 bits platforms, i_size_seqcount doesnt exist, and the move of a 'long i_version' should not introduce a new hole because of padding. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index d791bae9de9c..3a1927e516d0 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -548,12 +548,15 @@ struct inode {
548 uid_t i_uid; 548 uid_t i_uid;
549 gid_t i_gid; 549 gid_t i_gid;
550 dev_t i_rdev; 550 dev_t i_rdev;
551 unsigned long i_version;
551 loff_t i_size; 552 loff_t i_size;
553#ifdef __NEED_I_SIZE_ORDERED
554 seqcount_t i_size_seqcount;
555#endif
552 struct timespec i_atime; 556 struct timespec i_atime;
553 struct timespec i_mtime; 557 struct timespec i_mtime;
554 struct timespec i_ctime; 558 struct timespec i_ctime;
555 unsigned int i_blkbits; 559 unsigned int i_blkbits;
556 unsigned long i_version;
557 blkcnt_t i_blocks; 560 blkcnt_t i_blocks;
558 unsigned short i_bytes; 561 unsigned short i_bytes;
559 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 562 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
@@ -598,9 +601,6 @@ struct inode {
598 void *i_security; 601 void *i_security;
599#endif 602#endif
600 void *i_private; /* fs or device private pointer */ 603 void *i_private; /* fs or device private pointer */
601#ifdef __NEED_I_SIZE_ORDERED
602 seqcount_t i_size_seqcount;
603#endif
604}; 604};
605 605
606/* 606/*