Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
open.c File Reference
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/fsnotify.h>
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/namei.h>
#include <linux/backing-dev.h>
#include <linux/capability.h>
#include <linux/securebits.h>
#include <linux/security.h>
#include <linux/mount.h>
#include <linux/fcntl.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include <linux/fs.h>
#include <linux/personality.h>
#include <linux/pagemap.h>
#include <linux/syscalls.h>
#include <linux/rcupdate.h>
#include <linux/audit.h>
#include <linux/falloc.h>
#include <linux/fs_struct.h>
#include <linux/ima.h>
#include <linux/dnotify.h>
#include "internal.h"

Go to the source code of this file.

Functions

int do_truncate (struct dentry *dentry, loff_t length, unsigned int time_attrs, struct file *filp)
 
 SYSCALL_DEFINE2 (truncate, const char __user *, path, long, length)
 
 SYSCALL_DEFINE2 (ftruncate, unsigned int, fd, unsigned long, length)
 
int do_fallocate (struct file *file, int mode, loff_t offset, loff_t len)
 
SYSCALL_DEFINE() fallocate (int fd, int mode, loff_t offset, loff_t len)
 
 SYSCALL_DEFINE3 (faccessat, int, dfd, const char __user *, filename, int, mode)
 
 SYSCALL_DEFINE2 (access, const char __user *, filename, int, mode)
 
 SYSCALL_DEFINE1 (chdir, const char __user *, filename)
 
 SYSCALL_DEFINE1 (fchdir, unsigned int, fd)
 
 SYSCALL_DEFINE1 (chroot, const char __user *, filename)
 
 SYSCALL_DEFINE2 (fchmod, unsigned int, fd, umode_t, mode)
 
 SYSCALL_DEFINE3 (fchmodat, int, dfd, const char __user *, filename, umode_t, mode)
 
 SYSCALL_DEFINE2 (chmod, const char __user *, filename, umode_t, mode)
 
 SYSCALL_DEFINE5 (fchownat, int, dfd, const char __user *, filename, uid_t, user, gid_t, group, int, flag)
 
 SYSCALL_DEFINE3 (chown, const char __user *, filename, uid_t, user, gid_t, group)
 
 SYSCALL_DEFINE3 (lchown, const char __user *, filename, uid_t, user, gid_t, group)
 
 SYSCALL_DEFINE3 (fchown, unsigned int, fd, uid_t, user, gid_t, group)
 
int open_check_o_direct (struct file *f)
 
int finish_open (struct file *file, struct dentry *dentry, int(*open)(struct inode *, struct file *), int *opened)
 
 EXPORT_SYMBOL (finish_open)
 
int finish_no_open (struct file *file, struct dentry *dentry)
 
 EXPORT_SYMBOL (finish_no_open)
 
struct filedentry_open (const struct path *path, int flags, const struct cred *cred)
 
 EXPORT_SYMBOL (dentry_open)
 
: struct filename containing path to open

file_open_name - open file and return file pointer

: open flags as per the open(2) second argument : mode for the new file if O_CREAT is set, else ignored

This is the helper to open a file from kernelspace if you really have to. But in generally you should not do this, so please move along, nothing to see here..

struct filefile_open_name (struct filename *name, int flags, umode_t mode)
 
struct filefilp_open (const char *filename, int flags, umode_t mode)
 
 EXPORT_SYMBOL (filp_open)
 
struct filefile_open_root (struct dentry *dentry, struct vfsmount *mnt, const char *filename, int flags)
 
 EXPORT_SYMBOL (file_open_root)
 
long do_sys_open (int dfd, const char __user *filename, int flags, umode_t mode)
 
 SYSCALL_DEFINE3 (open, const char __user *, filename, int, flags, umode_t, mode)
 
 SYSCALL_DEFINE4 (openat, int, dfd, const char __user *, filename, int, flags, umode_t, mode)
 
 SYSCALL_DEFINE2 (creat, const char __user *, pathname, umode_t, mode)
 
int filp_close (struct file *filp, fl_owner_t id)
 
 EXPORT_SYMBOL (filp_close)
 
 SYSCALL_DEFINE1 (close, unsigned int, fd)
 
 EXPORT_SYMBOL (sys_close)
 
 SYSCALL_DEFINE0 (vhangup)
 
int generic_file_open (struct inode *inode, struct file *filp)
 
 EXPORT_SYMBOL (generic_file_open)
 
int nonseekable_open (struct inode *inode, struct file *filp)
 
 EXPORT_SYMBOL (nonseekable_open)
 

Function Documentation

struct file* dentry_open ( const struct path path,
int  flags,
const struct cred cred 
)
read

Definition at line 767 of file open.c.

int do_fallocate ( struct file file,
int  mode,
loff_t  offset,
loff_t  len 
)

Definition at line 219 of file open.c.

long do_sys_open ( int  dfd,
const char __user filename,
int  flags,
umode_t  mode 
)

Definition at line 911 of file open.c.

int do_truncate ( struct dentry dentry,
loff_t  length,
unsigned int  time_attrs,
struct file filp 
)

Definition at line 36 of file open.c.

EXPORT_SYMBOL ( finish_open  )
EXPORT_SYMBOL ( finish_no_open  )
EXPORT_SYMBOL ( dentry_open  )
EXPORT_SYMBOL ( filp_open  )
EXPORT_SYMBOL ( file_open_root  )
EXPORT_SYMBOL ( filp_close  )
EXPORT_SYMBOL ( sys_close  )
EXPORT_SYMBOL ( generic_file_open  )
EXPORT_SYMBOL ( nonseekable_open  )
SYSCALL_DEFINE() fallocate ( int  fd,
int  mode,
loff_t  offset,
loff_t  len 
)

Definition at line 277 of file open.c.

struct file* file_open_name ( struct filename name,
int  flags,
umode_t  mode 
)
read

Definition at line 872 of file open.c.

struct file* file_open_root ( struct dentry dentry,
struct vfsmount mnt,
const char filename,
int  flags 
)
read

Definition at line 897 of file open.c.

int filp_close ( struct file filp,
fl_owner_t  id 
)

Definition at line 979 of file open.c.

struct file* filp_open ( const char filename,
int  flags,
umode_t  mode 
)
read

filp_open - open file and return file pointer

: path to open : open flags as per the open(2) second argument : mode for the new file if O_CREAT is set, else ignored

This is the helper to open a file from kernelspace if you really have to. But in generally you should not do this, so please move along, nothing to see here..

Definition at line 890 of file open.c.

int finish_no_open ( struct file file,
struct dentry dentry 
)

finish_no_open - finish ->atomic_open() without opening the file

: opaque open data : dentry or NULL (as returned from ->lookup())

This can be used to set the result of a successful lookup in ->atomic_open(). The filesystem's atomic_open() method shall return NULL after calling this.

Definition at line 760 of file open.c.

int finish_open ( struct file file,
struct dentry dentry,
int(*)(struct inode *, struct file *)  open,
int opened 
)

finish_open - finish opening a file : opaque open data : pointer to dentry : open callback

This can be used to finish opening a file passed to i_op->atomic_open().

If the open callback is set to NULL, then the standard f_op->open() filesystem callback is substituted.

Definition at line 735 of file open.c.

int generic_file_open ( struct inode inode,
struct file filp 
)

Definition at line 1040 of file open.c.

int nonseekable_open ( struct inode inode,
struct file filp 
)

Definition at line 1055 of file open.c.

int open_check_o_direct ( struct file f)

Definition at line 629 of file open.c.

SYSCALL_DEFINE0 ( vhangup  )

Definition at line 1025 of file open.c.

SYSCALL_DEFINE1 ( chdir  ,
const char __user ,
filename   
)

Definition at line 378 of file open.c.

SYSCALL_DEFINE1 ( fchdir  ,
unsigned  int,
fd   
)

Definition at line 399 of file open.c.

SYSCALL_DEFINE1 ( chroot  ,
const char __user ,
filename   
)

Definition at line 424 of file open.c.

SYSCALL_DEFINE1 ( close  ,
unsigned  int,
fd   
)

Definition at line 1006 of file open.c.

SYSCALL_DEFINE2 ( truncate  ,
const char __user ,
path  ,
long  ,
length   
)

Definition at line 128 of file open.c.

SYSCALL_DEFINE2 ( ftruncate  ,
unsigned  int,
fd  ,
unsigned  long,
length   
)

Definition at line 180 of file open.c.

SYSCALL_DEFINE2 ( access  ,
const char __user ,
filename  ,
int  ,
mode   
)

Definition at line 373 of file open.c.

SYSCALL_DEFINE2 ( fchmod  ,
unsigned  int,
fd  ,
umode_t  ,
mode   
)

Definition at line 474 of file open.c.

SYSCALL_DEFINE2 ( chmod  ,
const char __user ,
filename  ,
umode_t  ,
mode   
)

Definition at line 501 of file open.c.

SYSCALL_DEFINE2 ( creat  ,
const char __user ,
pathname  ,
umode_t  ,
mode   
)

Definition at line 968 of file open.c.

SYSCALL_DEFINE3 ( faccessat  ,
int  ,
dfd  ,
const char __user ,
filename  ,
int  ,
mode   
)

Definition at line 302 of file open.c.

SYSCALL_DEFINE3 ( fchmodat  ,
int  ,
dfd  ,
const char __user ,
filename  ,
umode_t  ,
mode   
)

Definition at line 488 of file open.c.

SYSCALL_DEFINE3 ( chown  ,
const char __user ,
filename  ,
uid_t  ,
user  ,
gid_t  ,
group   
)

Definition at line 569 of file open.c.

SYSCALL_DEFINE3 ( lchown  ,
const char __user ,
filename  ,
uid_t  ,
user  ,
gid_t  ,
group   
)

Definition at line 574 of file open.c.

SYSCALL_DEFINE3 ( fchown  ,
unsigned  int,
fd  ,
uid_t  ,
user  ,
gid_t  ,
group   
)

Definition at line 580 of file open.c.

SYSCALL_DEFINE3 ( open  ,
const char __user ,
filename  ,
int  ,
flags  ,
umode_t  ,
mode   
)

Definition at line 935 of file open.c.

SYSCALL_DEFINE4 ( openat  ,
int  ,
dfd  ,
const char __user ,
filename  ,
int  ,
flags  ,
umode_t  ,
mode   
)

Definition at line 948 of file open.c.

SYSCALL_DEFINE5 ( fchownat  ,
int  ,
dfd  ,
const char __user ,
filename  ,
uid_t  ,
user  ,
gid_t  ,
group  ,
int  ,
flag   
)

Definition at line 542 of file open.c.