mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	get rid of files_defer_init()
the only thing it's doing these days is calculation of upper limit for fs.nr_open sysctl and that can be done statically Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									4d35950734
								
							
						
					
					
						commit
						7f4b36f9bb
					
				
					 3 changed files with 4 additions and 10 deletions
				
			
		
							
								
								
									
										11
									
								
								fs/file.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								fs/file.c
									
									
									
									
									
								
							| 
						 | 
					@ -25,7 +25,10 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int sysctl_nr_open __read_mostly = 1024*1024;
 | 
					int sysctl_nr_open __read_mostly = 1024*1024;
 | 
				
			||||||
int sysctl_nr_open_min = BITS_PER_LONG;
 | 
					int sysctl_nr_open_min = BITS_PER_LONG;
 | 
				
			||||||
int sysctl_nr_open_max = 1024 * 1024; /* raised later */
 | 
					/* our max() is unusable in constant expressions ;-/ */
 | 
				
			||||||
 | 
					#define __const_max(x, y) ((x) < (y) ? (x) : (y))
 | 
				
			||||||
 | 
					int sysctl_nr_open_max = __const_max(INT_MAX, ~(size_t)0/sizeof(void *)) &
 | 
				
			||||||
 | 
								 -BITS_PER_LONG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void *alloc_fdmem(size_t size)
 | 
					static void *alloc_fdmem(size_t size)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -429,12 +432,6 @@ void exit_files(struct task_struct *tsk)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init files_defer_init(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	sysctl_nr_open_max = min((size_t)INT_MAX, ~(size_t)0/sizeof(void *)) &
 | 
					 | 
				
			||||||
			     -BITS_PER_LONG;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
struct files_struct init_files = {
 | 
					struct files_struct init_files = {
 | 
				
			||||||
	.count		= ATOMIC_INIT(1),
 | 
						.count		= ATOMIC_INIT(1),
 | 
				
			||||||
	.fdt		= &init_files.fdtab,
 | 
						.fdt		= &init_files.fdtab,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -325,6 +325,5 @@ void __init files_init(unsigned long mempages)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	n = (mempages * (PAGE_SIZE / 1024)) / 10;
 | 
						n = (mempages * (PAGE_SIZE / 1024)) / 10;
 | 
				
			||||||
	files_stat.max_files = max_t(unsigned long, n, NR_FILE);
 | 
						files_stat.max_files = max_t(unsigned long, n, NR_FILE);
 | 
				
			||||||
	files_defer_init();
 | 
					 | 
				
			||||||
	percpu_counter_init(&nr_files, 0);
 | 
						percpu_counter_init(&nr_files, 0);
 | 
				
			||||||
} 
 | 
					} 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,8 +63,6 @@ struct file_operations;
 | 
				
			||||||
struct vfsmount;
 | 
					struct vfsmount;
 | 
				
			||||||
struct dentry;
 | 
					struct dentry;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern void __init files_defer_init(void);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define rcu_dereference_check_fdtable(files, fdtfd) \
 | 
					#define rcu_dereference_check_fdtable(files, fdtfd) \
 | 
				
			||||||
	rcu_dereference_check((fdtfd), lockdep_is_held(&(files)->file_lock))
 | 
						rcu_dereference_check((fdtfd), lockdep_is_held(&(files)->file_lock))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue