Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
file.c File Reference
#include <linux/syscalls.h>
#include <linux/export.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/mmzone.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/bitops.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  fdtable_defer
 

Functions

struct files_structdup_fd (struct files_struct *oldf, int *errorp)
 
struct files_structget_files_struct (struct task_struct *task)
 
void put_files_struct (struct files_struct *files)
 
void reset_files_struct (struct files_struct *files)
 
void exit_files (struct task_struct *tsk)
 
void __init files_defer_init (void)
 
void daemonize_descriptors (void)
 
int __alloc_fd (struct files_struct *files, unsigned start, unsigned end, unsigned flags)
 
int get_unused_fd_flags (unsigned flags)
 
 EXPORT_SYMBOL (get_unused_fd_flags)
 
void put_unused_fd (unsigned int fd)
 
 EXPORT_SYMBOL (put_unused_fd)
 
void __fd_install (struct files_struct *files, unsigned int fd, struct file *file)
 
void fd_install (unsigned int fd, struct file *file)
 
 EXPORT_SYMBOL (fd_install)
 
int __close_fd (struct files_struct *files, unsigned fd)
 
void do_close_on_exec (struct files_struct *files)
 
struct filefget (unsigned int fd)
 
 EXPORT_SYMBOL (fget)
 
struct filefget_raw (unsigned int fd)
 
 EXPORT_SYMBOL (fget_raw)
 
struct filefget_light (unsigned int fd, int *fput_needed)
 
 EXPORT_SYMBOL (fget_light)
 
struct filefget_raw_light (unsigned int fd, int *fput_needed)
 
void set_close_on_exec (unsigned int fd, int flag)
 
bool get_close_on_exec (unsigned int fd)
 
int replace_fd (unsigned fd, struct file *file, unsigned flags)
 
 SYSCALL_DEFINE3 (dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
 
 SYSCALL_DEFINE2 (dup2, unsigned int, oldfd, unsigned int, newfd)
 
 SYSCALL_DEFINE1 (dup, unsigned int, fildes)
 
int f_dupfd (unsigned int from, struct file *file, unsigned flags)
 
int iterate_fd (struct files_struct *files, unsigned n, int(*f)(const void *, struct file *, unsigned), const void *p)
 
 EXPORT_SYMBOL (iterate_fd)
 

Variables

int sysctl_nr_open __read_mostly = 1024*1024
 
int sysctl_nr_open_min = BITS_PER_LONG
 
int sysctl_nr_open_max = 1024 * 1024
 
struct files_struct init_files
 

Function Documentation

int __alloc_fd ( struct files_struct files,
unsigned  start,
unsigned  end,
unsigned  flags 
)

Definition at line 531 of file file.c.

int __close_fd ( struct files_struct files,
unsigned  fd 
)

Definition at line 659 of file file.c.

void __fd_install ( struct files_struct files,
unsigned int  fd,
struct file file 
)

Definition at line 638 of file file.c.

void daemonize_descriptors ( void  )

Definition at line 522 of file file.c.

void do_close_on_exec ( struct files_struct files)

Definition at line 682 of file file.c.

struct files_struct* dup_fd ( struct files_struct oldf,
int errorp 
)
read

Definition at line 298 of file file.c.

void exit_files ( struct task_struct tsk)

Definition at line 481 of file file.c.

EXPORT_SYMBOL ( get_unused_fd_flags  )
EXPORT_SYMBOL ( put_unused_fd  )
EXPORT_SYMBOL ( fd_install  )
EXPORT_SYMBOL ( fget  )
EXPORT_SYMBOL ( fget_raw  )
EXPORT_SYMBOL ( fget_light  )
EXPORT_SYMBOL ( iterate_fd  )
int f_dupfd ( unsigned int  from,
struct file file,
unsigned  flags 
)

Definition at line 979 of file file.c.

void fd_install ( unsigned int  fd,
struct file file 
)

Definition at line 649 of file file.c.

struct file* fget ( unsigned int  fd)
read

Definition at line 718 of file file.c.

struct file* fget_light ( unsigned int  fd,
int fput_needed 
)
read

Definition at line 773 of file file.c.

struct file* fget_raw ( unsigned int  fd)
read

Definition at line 738 of file file.c.

struct file* fget_raw_light ( unsigned int  fd,
int fput_needed 
)
read

Definition at line 801 of file file.c.

void __init files_defer_init ( void  )

Definition at line 501 of file file.c.

bool get_close_on_exec ( unsigned int  fd)

Definition at line 838 of file file.c.

struct files_struct* get_files_struct ( struct task_struct task)
read

Definition at line 439 of file file.c.

int get_unused_fd_flags ( unsigned  flags)

Definition at line 594 of file file.c.

int iterate_fd ( struct files_struct files,
unsigned  n,
int(*)(const void *, struct file *, unsigned)  f,
const void p 
)

Definition at line 992 of file file.c.

void put_files_struct ( struct files_struct files)

Definition at line 452 of file file.c.

void put_unused_fd ( unsigned int  fd)

Definition at line 608 of file file.c.

int replace_fd ( unsigned  fd,
struct file file,
unsigned  flags 
)

Definition at line 893 of file file.c.

void reset_files_struct ( struct files_struct files)

Definition at line 469 of file file.c.

void set_close_on_exec ( unsigned int  fd,
int  flag 
)

Definition at line 825 of file file.c.

SYSCALL_DEFINE1 ( dup  ,
unsigned  int,
fildes   
)

Definition at line 964 of file file.c.

SYSCALL_DEFINE2 ( dup2  ,
unsigned  int,
oldfd  ,
unsigned  int,
newfd   
)

Definition at line 949 of file file.c.

SYSCALL_DEFINE3 ( dup3  ,
unsigned  int,
oldfd  ,
unsigned  int,
newfd  ,
int  ,
flags   
)

Definition at line 915 of file file.c.

Variable Documentation

int sysctl_nr_open __read_mostly = 1024*1024

Definition at line 32 of file file.c.

struct files_struct init_files
Initial value:
= {
.count = ATOMIC_INIT(1),
.fdt = &init_files.fdtab,
.fdtab = {
.max_fds = NR_OPEN_DEFAULT,
.fd = &init_files.fd_array[0],
.close_on_exec = init_files.close_on_exec_init,
.open_fds = init_files.open_fds_init,
},
.file_lock = __SPIN_LOCK_UNLOCKED(init_task.file_lock),
}

Definition at line 510 of file file.c.

int sysctl_nr_open_max = 1024 * 1024

Definition at line 34 of file file.c.

int sysctl_nr_open_min = BITS_PER_LONG

Definition at line 33 of file file.c.