mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[PATCH] reduce sizeof(struct file)
Now that RCU applied on 'struct file' seems stable, we can place f_rcuhead in a memory location that is not anymore used at call_rcu(&f->f_rcuhead, file_free_rcu) time, to reduce the size of this critical kernel object. The trick I used is to move f_rcuhead and f_list in an union called f_u The callers are changed so that f_rcuhead becomes f_u.fu_rcuhead and f_list becomes f_u.f_list Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
503af334ec
commit
2f51201662
8 changed files with 21 additions and 15 deletions
|
|
@ -513,7 +513,7 @@ static void mark_files_ro(struct super_block *sb)
|
|||
struct file *f;
|
||||
|
||||
file_list_lock();
|
||||
list_for_each_entry(f, &sb->s_files, f_list) {
|
||||
list_for_each_entry(f, &sb->s_files, f_u.fu_list) {
|
||||
if (S_ISREG(f->f_dentry->d_inode->i_mode) && file_count(f))
|
||||
f->f_mode &= ~FMODE_WRITE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue