Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
file_table.c File Reference
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/security.h>
#include <linux/eventpoll.h>
#include <linux/rcupdate.h>
#include <linux/mount.h>
#include <linux/capability.h>
#include <linux/cdev.h>
#include <linux/fsnotify.h>
#include <linux/sysctl.h>
#include <linux/lglock.h>
#include <linux/percpu_counter.h>
#include <linux/percpu.h>
#include <linux/hardirq.h>
#include <linux/task_work.h>
#include <linux/ima.h>
#include <linux/atomic.h>
#include "internal.h"

Go to the source code of this file.

Macros

#define do_file_list_for_each_entry(__sb, __file)
 
#define while_file_list_for_each_entry   }
 

Functions

 DEFINE_STATIC_LGLOCK (files_lglock)
 
unsigned long get_max_files (void)
 
 EXPORT_SYMBOL_GPL (get_max_files)
 
int proc_nr_files (ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
 
struct fileget_empty_filp (void)
 
struct filealloc_file (struct path *path, fmode_t mode, const struct file_operations *fop)
 
 EXPORT_SYMBOL (alloc_file)
 
void flush_delayed_fput (void)
 
void fput (struct file *file)
 
void __fput_sync (struct file *file)
 
 EXPORT_SYMBOL (fput)
 
void put_filp (struct file *file)
 
void file_sb_list_add (struct file *file, struct super_block *sb)
 
void file_sb_list_del (struct file *file)
 
void mark_files_ro (struct super_block *sb)
 
void __init files_init (unsigned long mempages)
 

Variables

struct files_stat_struct files_stat
 

Macro Definition Documentation

#define do_file_list_for_each_entry (   __sb,
  __file 
)
Value:
{ \
list = &(sb)->s_files; \
list_for_each_entry((__file), list, f_u.fu_list)

Definition at line 426 of file file_table.c.

#define while_file_list_for_each_entry   }

Definition at line 432 of file file_table.c.

Function Documentation

void __fput_sync ( struct file file)

Definition at line 330 of file file_table.c.

struct file* alloc_file ( struct path path,
fmode_t  mode,
const struct file_operations fop 
)
read

alloc_file - allocate and initialize a 'struct file' : the vfsmount on which the file will reside : the dentry representing the new file : the mode with which the new file will be opened : the 'struct file_operations' for the new file

Use this instead of get_empty_filp() to get a new 'struct file'. Do so because of the same initialization pitfalls reasons listed for init_file(). This is a preferred interface to using init_file().

If all the callers of init_file() are eliminated, its code should be moved into this function.

Definition at line 170 of file file_table.c.

DEFINE_STATIC_LGLOCK ( files_lglock  )
EXPORT_SYMBOL ( alloc_file  )
EXPORT_SYMBOL ( fput  )
EXPORT_SYMBOL_GPL ( get_max_files  )
void file_sb_list_add ( struct file file,
struct super_block sb 
)

Definition at line 383 of file file_table.c.

void file_sb_list_del ( struct file file)

Definition at line 397 of file file_table.c.

void __init files_init ( unsigned long  mempages)

Definition at line 467 of file file_table.c.

void flush_delayed_fput ( void  )

Definition at line 297 of file file_table.c.

void fput ( struct file file)

Definition at line 304 of file file_table.c.

struct file* get_empty_filp ( void  )
read

Definition at line 106 of file file_table.c.

unsigned long get_max_files ( void  )

Definition at line 72 of file file_table.c.

void mark_files_ro ( struct super_block sb)

mark_files_ro - mark all files read-only : superblock in question

All files are marked read-only. We don't care about pending delete files so this should be used in 'force' mode only.

Definition at line 444 of file file_table.c.

int proc_nr_files ( ctl_table table,
int  write,
void __user buffer,
size_t lenp,
loff_t *  ppos 
)

Definition at line 89 of file file_table.c.

void put_filp ( struct file file)

Definition at line 342 of file file_table.c.

Variable Documentation

Initial value:
= {
.max_files = NR_FILE
}

Definition at line 35 of file file_table.c.