diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-31 18:57:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-31 18:57:56 -0500 |
commit | b58602a4bac012b5f4fc12fe6b46ab237b610d5d (patch) | |
tree | 38929e210a723f67fe2b945f37264bf3aae3c2c4 /fs/file_table.c | |
parent | db200df0b3530f673d8e9f5bd535e9e10305842a (diff) | |
parent | 1f3403fa640f9f7b135dee79f2d39d01c8ad4a08 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (34 commits)
nfsd race fixes: jfs
nfsd race fixes: reiserfs
nfsd race fixes: ext4
nfsd race fixes: ext3
nfsd race fixes: ext2
nfsd/create race fixes, infrastructure
filesystem notification: create fs/notify to contain all fs notification
fs/block_dev.c: __read_mostly improvement and sb_is_blkdev_sb utilization
kill ->dir_notify()
filp_cachep can be static in fs/file_table.c
fix f_count description in Documentation/filesystems/files.txt
make INIT_FS use the __RW_LOCK_UNLOCKED initialization
take init_fs to saner place
kill vfs_permission
pass a struct path * to may_open
kill walk_init_root
remove incorrect comment in inode_permission
expand some comments (d_path / seq_path)
correct wrong function name of d_put in kernel document and source comment
fix switch_names() breakage in short-to-short case
...
Diffstat (limited to 'fs/file_table.c')
-rw-r--r-- | fs/file_table.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index 0fbcacc3ea75..bbeeac6efa1a 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -32,6 +32,9 @@ struct files_stat_struct files_stat = { | |||
32 | /* public. Not pretty! */ | 32 | /* public. Not pretty! */ |
33 | __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock); | 33 | __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock); |
34 | 34 | ||
35 | /* SLAB cache for file structures */ | ||
36 | static struct kmem_cache *filp_cachep __read_mostly; | ||
37 | |||
35 | static struct percpu_counter nr_files __cacheline_aligned_in_smp; | 38 | static struct percpu_counter nr_files __cacheline_aligned_in_smp; |
36 | 39 | ||
37 | static inline void file_free_rcu(struct rcu_head *head) | 40 | static inline void file_free_rcu(struct rcu_head *head) |
@@ -397,7 +400,12 @@ too_bad: | |||
397 | void __init files_init(unsigned long mempages) | 400 | void __init files_init(unsigned long mempages) |
398 | { | 401 | { |
399 | int n; | 402 | int n; |
400 | /* One file with associated inode and dcache is very roughly 1K. | 403 | |
404 | filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, | ||
405 | SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); | ||
406 | |||
407 | /* | ||
408 | * One file with associated inode and dcache is very roughly 1K. | ||
401 | * Per default don't use more than 10% of our memory for files. | 409 | * Per default don't use more than 10% of our memory for files. |
402 | */ | 410 | */ |
403 | 411 | ||