Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
read_write.c File Reference
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/file.h>
#include <linux/uio.h>
#include <linux/fsnotify.h>
#include <linux/security.h>
#include <linux/export.h>
#include <linux/syscalls.h>
#include <linux/pagemap.h>
#include <linux/splice.h>
#include "read_write.h"
#include <asm/uaccess.h>
#include <asm/unistd.h>

Go to the source code of this file.

Macros

#define vrfy_dir(type)   ((type) == READ ? VERIFY_WRITE : VERIFY_READ)
 
#define HALF_LONG_BITS   (BITS_PER_LONG / 2)
 

Functions

 EXPORT_SYMBOL (generic_ro_fops)
 
loff_t generic_file_llseek_size (struct file *file, loff_t offset, int origin, loff_t maxsize, loff_t eof)
 
 EXPORT_SYMBOL (generic_file_llseek_size)
 
loff_t generic_file_llseek (struct file *file, loff_t offset, int origin)
 
 EXPORT_SYMBOL (generic_file_llseek)
 
loff_t noop_llseek (struct file *file, loff_t offset, int origin)
 
 EXPORT_SYMBOL (noop_llseek)
 
loff_t no_llseek (struct file *file, loff_t offset, int origin)
 
 EXPORT_SYMBOL (no_llseek)
 
loff_t default_llseek (struct file *file, loff_t offset, int origin)
 
 EXPORT_SYMBOL (default_llseek)
 
loff_t vfs_llseek (struct file *file, loff_t offset, int origin)
 
 EXPORT_SYMBOL (vfs_llseek)
 
 SYSCALL_DEFINE3 (lseek, unsigned int, fd, off_t, offset, unsigned int, origin)
 
int rw_verify_area (int read_write, struct file *file, loff_t *ppos, size_t count)
 
ssize_t do_sync_read (struct file *filp, char __user *buf, size_t len, loff_t *ppos)
 
 EXPORT_SYMBOL (do_sync_read)
 
ssize_t vfs_read (struct file *file, char __user *buf, size_t count, loff_t *pos)
 
 EXPORT_SYMBOL (vfs_read)
 
ssize_t do_sync_write (struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
 
 EXPORT_SYMBOL (do_sync_write)
 
ssize_t vfs_write (struct file *file, const char __user *buf, size_t count, loff_t *pos)
 
 EXPORT_SYMBOL (vfs_write)
 
 SYSCALL_DEFINE3 (read, unsigned int, fd, char __user *, buf, size_t, count)
 
 SYSCALL_DEFINE3 (write, unsigned int, fd, const char __user *, buf, size_t, count)
 
SYSCALL_DEFINE() pread64 (unsigned int fd, char __user *buf, size_t count, loff_t pos)
 
SYSCALL_DEFINE() pwrite64 (unsigned int fd, const char __user *buf, size_t count, loff_t pos)
 
unsigned long iov_shorten (struct iovec *iov, unsigned long nr_segs, size_t to)
 
 EXPORT_SYMBOL (iov_shorten)
 
ssize_t do_sync_readv_writev (struct file *filp, const struct iovec *iov, unsigned long nr_segs, size_t len, loff_t *ppos, iov_fn_t fn)
 
ssize_t do_loop_readv_writev (struct file *filp, struct iovec *iov, unsigned long nr_segs, loff_t *ppos, io_fn_t fn)
 
ssize_t rw_copy_check_uvector (int type, const struct iovec __user *uvector, unsigned long nr_segs, unsigned long fast_segs, struct iovec *fast_pointer, struct iovec **ret_pointer)
 
ssize_t vfs_readv (struct file *file, const struct iovec __user *vec, unsigned long vlen, loff_t *pos)
 
 EXPORT_SYMBOL (vfs_readv)
 
ssize_t vfs_writev (struct file *file, const struct iovec __user *vec, unsigned long vlen, loff_t *pos)
 
 EXPORT_SYMBOL (vfs_writev)
 
 SYSCALL_DEFINE3 (readv, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen)
 
 SYSCALL_DEFINE3 (writev, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen)
 
 SYSCALL_DEFINE5 (preadv, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h)
 
 SYSCALL_DEFINE5 (pwritev, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h)
 
ssize_t do_sendfile (int out_fd, int in_fd, loff_t *ppos, size_t count, loff_t max)
 
 SYSCALL_DEFINE4 (sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count)
 
 SYSCALL_DEFINE4 (sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count)
 

Variables

struct file_operations generic_ro_fops
 

Macro Definition Documentation

#define HALF_LONG_BITS   (BITS_PER_LONG / 2)
#define vrfy_dir (   type)    ((type) == READ ? VERIFY_WRITE : VERIFY_READ)

Definition at line 617 of file read_write.c.

Function Documentation

loff_t default_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 164 of file read_write.c.

ssize_t do_loop_readv_writev ( struct file filp,
struct iovec iov,
unsigned long  nr_segs,
loff_t *  ppos,
io_fn_t  fn 
)

Definition at line 585 of file read_write.c.

ssize_t do_sendfile ( int  out_fd,
int  in_fd,
loff_t *  ppos,
size_t  count,
loff_t  max 
)

Definition at line 865 of file read_write.c.

ssize_t do_sync_read ( struct file filp,
char __user buf,
size_t  len,
loff_t *  ppos 
)

Definition at line 331 of file read_write.c.

ssize_t do_sync_readv_writev ( struct file filp,
const struct iovec iov,
unsigned long  nr_segs,
size_t  len,
loff_t *  ppos,
iov_fn_t  fn 
)

Definition at line 560 of file read_write.c.

ssize_t do_sync_write ( struct file filp,
const char __user buf,
size_t  len,
loff_t *  ppos 
)

Definition at line 387 of file read_write.c.

EXPORT_SYMBOL ( generic_ro_fops  )
EXPORT_SYMBOL ( generic_file_llseek_size  )
EXPORT_SYMBOL ( generic_file_llseek  )
EXPORT_SYMBOL ( noop_llseek  )
EXPORT_SYMBOL ( no_llseek  )
EXPORT_SYMBOL ( default_llseek  )
EXPORT_SYMBOL ( vfs_llseek  )
EXPORT_SYMBOL ( do_sync_read  )
EXPORT_SYMBOL ( vfs_read  )
EXPORT_SYMBOL ( do_sync_write  )
EXPORT_SYMBOL ( vfs_write  )
EXPORT_SYMBOL ( iov_shorten  )
EXPORT_SYMBOL ( vfs_readv  )
EXPORT_SYMBOL ( vfs_writev  )
loff_t generic_file_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 131 of file read_write.c.

loff_t generic_file_llseek_size ( struct file file,
loff_t  offset,
int  origin,
loff_t  maxsize,
loff_t  eof 
)

Definition at line 70 of file read_write.c.

unsigned long iov_shorten ( struct iovec iov,
unsigned long  nr_segs,
size_t  to 
)

Definition at line 542 of file read_write.c.

loff_t no_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 158 of file read_write.c.

loff_t noop_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 152 of file read_write.c.

SYSCALL_DEFINE() pread64 ( unsigned int  fd,
char __user buf,
size_t  count,
loff_t  pos 
)

Definition at line 483 of file read_write.c.

SYSCALL_DEFINE() pwrite64 ( unsigned int  fd,
const char __user buf,
size_t  count,
loff_t  pos 
)

Definition at line 511 of file read_write.c.

ssize_t rw_copy_check_uvector ( int  type,
const struct iovec __user uvector,
unsigned long  nr_segs,
unsigned long  fast_segs,
struct iovec fast_pointer,
struct iovec **  ret_pointer 
)

Definition at line 619 of file read_write.c.

int rw_verify_area ( int  read_write,
struct file file,
loff_t *  ppos,
size_t  count 
)

Definition at line 287 of file read_write.c.

SYSCALL_DEFINE3 ( lseek  ,
unsigned  int,
fd  ,
off_t  ,
offset  ,
unsigned  int,
origin   
)

Definition at line 232 of file read_write.c.

SYSCALL_DEFINE3 ( read  ,
unsigned  int,
fd  ,
char __user ,
buf  ,
size_t  ,
count   
)

Definition at line 453 of file read_write.c.

SYSCALL_DEFINE3 ( write  ,
unsigned  int,
fd  ,
const char __user ,
buf  ,
size_t  ,
count   
)

Definition at line 467 of file read_write.c.

SYSCALL_DEFINE3 ( readv  ,
unsigned  long,
fd  ,
const struct iovec __user ,
vec  ,
unsigned  long,
vlen   
)

Definition at line 773 of file read_write.c.

SYSCALL_DEFINE3 ( writev  ,
unsigned  long,
fd  ,
const struct iovec __user ,
vec  ,
unsigned  long,
vlen   
)

Definition at line 792 of file read_write.c.

SYSCALL_DEFINE4 ( sendfile  ,
int  ,
out_fd  ,
int  ,
in_fd  ,
off_t __user ,
offset  ,
size_t  ,
count   
)

Definition at line 953 of file read_write.c.

SYSCALL_DEFINE4 ( sendfile64  ,
int  ,
out_fd  ,
int  ,
in_fd  ,
loff_t __user ,
offset  ,
size_t  ,
count   
)

Definition at line 972 of file read_write.c.

SYSCALL_DEFINE5 ( preadv  ,
unsigned  long,
fd  ,
const struct iovec __user ,
vec  ,
unsigned  long,
vlen  ,
unsigned  long,
pos_l  ,
unsigned  long,
pos_h   
)

Definition at line 817 of file read_write.c.

SYSCALL_DEFINE5 ( pwritev  ,
unsigned  long,
fd  ,
const struct iovec __user ,
vec  ,
unsigned  long,
vlen  ,
unsigned  long,
pos_l  ,
unsigned  long,
pos_h   
)

Definition at line 841 of file read_write.c.

loff_t vfs_llseek ( struct file file,
loff_t  offset,
int  origin 
)

Definition at line 219 of file read_write.c.

ssize_t vfs_read ( struct file file,
char __user buf,
size_t  count,
loff_t *  pos 
)

Definition at line 357 of file read_write.c.

ssize_t vfs_readv ( struct file file,
const struct iovec __user vec,
unsigned long  vlen,
loff_t *  pos 
)

Definition at line 747 of file read_write.c.

ssize_t vfs_write ( struct file file,
const char __user buf,
size_t  count,
loff_t *  pos 
)

Definition at line 413 of file read_write.c.

ssize_t vfs_writev ( struct file file,
const struct iovec __user vec,
unsigned long  vlen,
loff_t *  pos 
)

Definition at line 760 of file read_write.c.

Variable Documentation

struct file_operations generic_ro_fops
Initial value:
= {
.read = do_sync_read,
.aio_read = generic_file_aio_read,
.splice_read = generic_file_splice_read,
}

Definition at line 23 of file read_write.c.