diff options
author | Theodore Ts'o <tytso@mit.edu> | 2006-09-27 04:50:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 11:26:17 -0400 |
commit | 8e18e2941c53416aa219708e7dcad21fb4bd6794 (patch) | |
tree | 44118f8b09556193ac93e0b71aecfa3e1d4bc182 /fs/binfmt_misc.c | |
parent | 6a1d9805ec506d8b9d04450997707da5f643d87c (diff) |
[PATCH] inode_diet: Replace inode.u.generic_ip with inode.i_private
The following patches reduce the size of the VFS inode structure by 28 bytes
on a UP x86. (It would be more on an x86_64 system). This is a 10% reduction
in the inode size on a UP kernel that is configured in a production mode
(i.e., with no spinlock or other debugging functions enabled; if you want to
save memory taken up by in-core inodes, the first thing you should do is
disable the debugging options; they are responsible for a huge amount of bloat
in the VFS inode structure).
This patch:
The filesystem or device-specific pointer in the inode is inside a union,
which is pretty pointless given that all 30+ users of this field have been
using the void pointer. Get rid of the union and rename it to i_private, with
a comment to explain who is allowed to use the void pointer. This is just a
cleanup, but it allows us to reuse the union 'u' for something something where
the union will actually be used.
[judith@osdl.org: powerpc build fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Judith Lebzelter <judith@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/binfmt_misc.c')
-rw-r--r-- | fs/binfmt_misc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 34ebbc191e46..6759b9839ce8 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
@@ -517,7 +517,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) | |||
517 | 517 | ||
518 | static void bm_clear_inode(struct inode *inode) | 518 | static void bm_clear_inode(struct inode *inode) |
519 | { | 519 | { |
520 | kfree(inode->u.generic_ip); | 520 | kfree(inode->i_private); |
521 | } | 521 | } |
522 | 522 | ||
523 | static void kill_node(Node *e) | 523 | static void kill_node(Node *e) |
@@ -545,7 +545,7 @@ static void kill_node(Node *e) | |||
545 | static ssize_t | 545 | static ssize_t |
546 | bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) | 546 | bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) |
547 | { | 547 | { |
548 | Node *e = file->f_dentry->d_inode->u.generic_ip; | 548 | Node *e = file->f_dentry->d_inode->i_private; |
549 | loff_t pos = *ppos; | 549 | loff_t pos = *ppos; |
550 | ssize_t res; | 550 | ssize_t res; |
551 | char *page; | 551 | char *page; |
@@ -579,7 +579,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer, | |||
579 | size_t count, loff_t *ppos) | 579 | size_t count, loff_t *ppos) |
580 | { | 580 | { |
581 | struct dentry *root; | 581 | struct dentry *root; |
582 | Node *e = file->f_dentry->d_inode->u.generic_ip; | 582 | Node *e = file->f_dentry->d_inode->i_private; |
583 | int res = parse_command(buffer, count); | 583 | int res = parse_command(buffer, count); |
584 | 584 | ||
585 | switch (res) { | 585 | switch (res) { |
@@ -646,7 +646,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer, | |||
646 | } | 646 | } |
647 | 647 | ||
648 | e->dentry = dget(dentry); | 648 | e->dentry = dget(dentry); |
649 | inode->u.generic_ip = e; | 649 | inode->i_private = e; |
650 | inode->i_fop = &bm_entry_operations; | 650 | inode->i_fop = &bm_entry_operations; |
651 | 651 | ||
652 | d_instantiate(dentry, inode); | 652 | d_instantiate(dentry, inode); |