Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
file.h File Reference
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/posix_types.h>

Go to the source code of this file.

Data Structures

struct  fd
 

Macros

#define get_unused_fd()   get_unused_fd_flags(0)
 

Functions

void fput (struct file *)
 
struct filealloc_file (struct path *, fmode_t mode, const struct file_operations *fop)
 
struct filefget (unsigned int fd)
 
struct filefget_light (unsigned int fd, int *fput_needed)
 
struct filefget_raw (unsigned int fd)
 
struct filefget_raw_light (unsigned int fd, int *fput_needed)
 
int f_dupfd (unsigned int from, struct file *file, unsigned flags)
 
int replace_fd (unsigned fd, struct file *file, unsigned flags)
 
void set_close_on_exec (unsigned int fd, int flag)
 
bool get_close_on_exec (unsigned int fd)
 
void put_filp (struct file *)
 
int get_unused_fd_flags (unsigned flags)
 
void put_unused_fd (unsigned int fd)
 
void fd_install (unsigned int fd, struct file *file)
 
void flush_delayed_fput (void)
 
void __fput_sync (struct file *)
 

Macro Definition Documentation

#define get_unused_fd ( )    get_unused_fd_flags(0)

Definition at line 66 of file file.h.

Function Documentation

void __fput_sync ( struct 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.

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 flush_delayed_fput ( void  )

Definition at line 297 of file file_table.c.

void fput ( struct file )

Definition at line 304 of file file_table.c.

bool get_close_on_exec ( unsigned int  fd)

Definition at line 838 of file file.c.

int get_unused_fd_flags ( unsigned  flags)

Definition at line 594 of file file.c.

void put_filp ( struct file )

Definition at line 342 of file file_table.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 set_close_on_exec ( unsigned int  fd,
int  flag 
)

Definition at line 825 of file file.c.