Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
libfs.c File Reference
#include <linux/export.h>
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <linux/mount.h>
#include <linux/vfs.h>
#include <linux/quotaops.h>
#include <linux/mutex.h>
#include <linux/exportfs.h>
#include <linux/writeback.h>
#include <linux/buffer_head.h>
#include <asm/uaccess.h>
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  simple_attr
 

Functions

int simple_getattr (struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
 
int simple_statfs (struct dentry *dentry, struct kstatfs *buf)
 
struct dentrysimple_lookup (struct inode *dir, struct dentry *dentry, unsigned int flags)
 
int dcache_dir_open (struct inode *inode, struct file *file)
 
int dcache_dir_close (struct inode *inode, struct file *file)
 
loff_t dcache_dir_lseek (struct file *file, loff_t offset, int origin)
 
int dcache_readdir (struct file *filp, void *dirent, filldir_t filldir)
 
ssize_t generic_read_dir (struct file *filp, char __user *buf, size_t siz, loff_t *ppos)
 
struct dentrymount_pseudo (struct file_system_type *fs_type, char *name, const struct super_operations *ops, const struct dentry_operations *dops, unsigned long magic)
 
int simple_open (struct inode *inode, struct file *file)
 
int simple_link (struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
 
int simple_empty (struct dentry *dentry)
 
int simple_unlink (struct inode *dir, struct dentry *dentry)
 
int simple_rmdir (struct inode *dir, struct dentry *dentry)
 
int simple_rename (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry)
 
int simple_setattr (struct dentry *dentry, struct iattr *iattr)
 
 EXPORT_SYMBOL (simple_setattr)
 
int simple_readpage (struct file *file, struct page *page)
 
int simple_write_begin (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata)
 
int simple_write_end (struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned copied, struct page *page, void *fsdata)
 
int simple_fill_super (struct super_block *s, unsigned long magic, struct tree_descr *files)
 
int simple_pin_fs (struct file_system_type *type, struct vfsmount **mount, int *count)
 
void simple_release_fs (struct vfsmount **mount, int *count)
 
ssize_t simple_read_from_buffer (void __user *to, size_t count, loff_t *ppos, const void *from, size_t available)
 
ssize_t simple_write_to_buffer (void *to, size_t available, loff_t *ppos, const void __user *from, size_t count)
 
ssize_t memory_read_from_buffer (void *to, size_t count, loff_t *ppos, const void *from, size_t available)
 
void simple_transaction_set (struct file *file, size_t n)
 
charsimple_transaction_get (struct file *file, const char __user *buf, size_t size)
 
ssize_t simple_transaction_read (struct file *file, char __user *buf, size_t size, loff_t *pos)
 
int simple_transaction_release (struct inode *inode, struct file *file)
 
int simple_attr_open (struct inode *inode, struct file *file, int(*get)(void *, u64 *), int(*set)(void *, u64), const char *fmt)
 
int simple_attr_release (struct inode *inode, struct file *file)
 
ssize_t simple_attr_read (struct file *file, char __user *buf, size_t len, loff_t *ppos)
 
ssize_t simple_attr_write (struct file *file, const char __user *buf, size_t len, loff_t *ppos)
 
struct dentrygeneric_fh_to_dentry (struct super_block *sb, struct fid *fid, int fh_len, int fh_type, struct inode *(*get_inode)(struct super_block *sb, u64 ino, u32 gen))
 
 EXPORT_SYMBOL_GPL (generic_fh_to_dentry)
 
struct dentrygeneric_fh_to_parent (struct super_block *sb, struct fid *fid, int fh_len, int fh_type, struct inode *(*get_inode)(struct super_block *sb, u64 ino, u32 gen))
 
 EXPORT_SYMBOL_GPL (generic_fh_to_parent)
 
int generic_file_fsync (struct file *file, loff_t start, loff_t end, int datasync)
 
 EXPORT_SYMBOL (generic_file_fsync)
 
int generic_check_addressable (unsigned blocksize_bits, u64 num_blocks)
 
 EXPORT_SYMBOL (generic_check_addressable)
 
int noop_fsync (struct file *file, loff_t start, loff_t end, int datasync)
 
 EXPORT_SYMBOL (dcache_dir_close)
 
 EXPORT_SYMBOL (dcache_dir_lseek)
 
 EXPORT_SYMBOL (dcache_dir_open)
 
 EXPORT_SYMBOL (dcache_readdir)
 
 EXPORT_SYMBOL (generic_read_dir)
 
 EXPORT_SYMBOL (mount_pseudo)
 
 EXPORT_SYMBOL (simple_write_begin)
 
 EXPORT_SYMBOL (simple_write_end)
 
 EXPORT_SYMBOL (simple_dir_inode_operations)
 
 EXPORT_SYMBOL (simple_dir_operations)
 
 EXPORT_SYMBOL (simple_empty)
 
 EXPORT_SYMBOL (simple_fill_super)
 
 EXPORT_SYMBOL (simple_getattr)
 
 EXPORT_SYMBOL (simple_open)
 
 EXPORT_SYMBOL (simple_link)
 
 EXPORT_SYMBOL (simple_lookup)
 
 EXPORT_SYMBOL (simple_pin_fs)
 
 EXPORT_SYMBOL (simple_readpage)
 
 EXPORT_SYMBOL (simple_release_fs)
 
 EXPORT_SYMBOL (simple_rename)
 
 EXPORT_SYMBOL (simple_rmdir)
 
 EXPORT_SYMBOL (simple_statfs)
 
 EXPORT_SYMBOL (noop_fsync)
 
 EXPORT_SYMBOL (simple_unlink)
 
 EXPORT_SYMBOL (simple_read_from_buffer)
 
 EXPORT_SYMBOL (simple_write_to_buffer)
 
 EXPORT_SYMBOL (memory_read_from_buffer)
 
 EXPORT_SYMBOL (simple_transaction_set)
 
 EXPORT_SYMBOL (simple_transaction_get)
 
 EXPORT_SYMBOL (simple_transaction_read)
 
 EXPORT_SYMBOL (simple_transaction_release)
 
 EXPORT_SYMBOL_GPL (simple_attr_open)
 
 EXPORT_SYMBOL_GPL (simple_attr_release)
 
 EXPORT_SYMBOL_GPL (simple_attr_read)
 
 EXPORT_SYMBOL_GPL (simple_attr_write)
 

Variables

struct file_operations simple_dir_operations
 
struct inode_operations simple_dir_inode_operations
 

Detailed Description

simple_write_end - .write_end helper for non-block-device FSes : See .write_end of address_space_operations

: " @pos: " : " @copied: "

Definition in file libfs.c.

Function Documentation

int dcache_dir_close ( struct inode inode,
struct file file 
)

Definition at line 78 of file libfs.c.

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

Definition at line 84 of file libfs.c.

int dcache_dir_open ( struct inode inode,
struct file file 
)

Definition at line 69 of file libfs.c.

int dcache_readdir ( struct file filp,
void dirent,
filldir_t  filldir 
)

Definition at line 138 of file libfs.c.

EXPORT_SYMBOL ( simple_setattr  )
EXPORT_SYMBOL ( generic_file_fsync  )
EXPORT_SYMBOL ( generic_check_addressable  )
EXPORT_SYMBOL ( dcache_dir_close  )
EXPORT_SYMBOL ( dcache_dir_lseek  )
EXPORT_SYMBOL ( dcache_dir_open  )
EXPORT_SYMBOL ( dcache_readdir  )
EXPORT_SYMBOL ( generic_read_dir  )
EXPORT_SYMBOL ( mount_pseudo  )
EXPORT_SYMBOL ( simple_write_begin  )
EXPORT_SYMBOL ( simple_write_end  )
EXPORT_SYMBOL ( simple_dir_inode_operations  )
EXPORT_SYMBOL ( simple_dir_operations  )
EXPORT_SYMBOL ( simple_empty  )
EXPORT_SYMBOL ( simple_fill_super  )
EXPORT_SYMBOL ( simple_getattr  )
EXPORT_SYMBOL ( simple_open  )
EXPORT_SYMBOL ( simple_link  )
EXPORT_SYMBOL ( simple_lookup  )
EXPORT_SYMBOL ( simple_pin_fs  )
EXPORT_SYMBOL ( simple_readpage  )
EXPORT_SYMBOL ( simple_release_fs  )
EXPORT_SYMBOL ( simple_rename  )
EXPORT_SYMBOL ( simple_rmdir  )
EXPORT_SYMBOL ( simple_statfs  )
EXPORT_SYMBOL ( noop_fsync  )
EXPORT_SYMBOL ( simple_unlink  )
EXPORT_SYMBOL ( simple_read_from_buffer  )
EXPORT_SYMBOL ( simple_write_to_buffer  )
EXPORT_SYMBOL ( memory_read_from_buffer  )
EXPORT_SYMBOL ( simple_transaction_set  )
EXPORT_SYMBOL ( simple_transaction_get  )
EXPORT_SYMBOL ( simple_transaction_read  )
EXPORT_SYMBOL ( simple_transaction_release  )
EXPORT_SYMBOL_GPL ( generic_fh_to_dentry  )
EXPORT_SYMBOL_GPL ( generic_fh_to_parent  )
EXPORT_SYMBOL_GPL ( simple_attr_open  )
EXPORT_SYMBOL_GPL ( simple_attr_release  )
EXPORT_SYMBOL_GPL ( simple_attr_read  )
EXPORT_SYMBOL_GPL ( simple_attr_write  )
int generic_check_addressable ( unsigned  blocksize_bits,
u64  num_blocks 
)

generic_check_addressable - Check addressability of file system : log of file system block size : number of blocks in file system

Determine whether a file system with blocks (and a block size of 2**) is addressable by the sector_t and page cache of the system. Return 0 if so and -EFBIG otherwise.

Definition at line 954 of file libfs.c.

struct dentry* generic_fh_to_dentry ( struct super_block sb,
struct fid fid,
int  fh_len,
int  fh_type,
struct inode *(*)(struct super_block *sb, u64 ino, u32 gen get_inode 
)
read

generic_fh_to_dentry - generic helper for the fh_to_dentry export operation : filesystem to do the file handle conversion on : file handle to convert : length of the file handle in bytes : type of file handle : filesystem callback to retrieve inode

This function decodes as long as it has one of the well-known Linux filehandle types and calls on it to retrieve the inode for the object specified in the file handle.

Definition at line 856 of file libfs.c.

struct dentry* generic_fh_to_parent ( struct super_block sb,
struct fid fid,
int  fh_len,
int  fh_type,
struct inode *(*)(struct super_block *sb, u64 ino, u32 gen get_inode 
)
read

generic_fh_to_parent - generic helper for the fh_to_parent export operation : filesystem to do the file handle conversion on : file handle to convert : length of the file handle in bytes : type of file handle : filesystem callback to retrieve inode

This function decodes as long as it has one of the well-known Linux filehandle types and calls on it to retrieve the inode for the parent object specified in the file handle if it is specified in the file handle, or NULL otherwise.

Definition at line 889 of file libfs.c.

int generic_file_fsync ( struct file file,
loff_t  start,
loff_t  end,
int  datasync 
)

Definition at line 918 of file libfs.c.

ssize_t generic_read_dir ( struct file filp,
char __user buf,
size_t  siz,
loff_t *  ppos 
)

Definition at line 195 of file libfs.c.

ssize_t memory_read_from_buffer ( void to,
size_t  count,
loff_t *  ppos,
const void from,
size_t  available 
)

memory_read_from_buffer - copy data from the buffer : the kernel space buffer to read to : the maximum number of bytes to read : the current position in the buffer : the buffer to read from : the size of the buffer

The memory_read_from_buffer() function reads up to bytes from the buffer at offset into the kernel space address starting at .

On success, the number of bytes read is returned and the offset is advanced by this number, or negative value is returned on error.

Definition at line 652 of file libfs.c.

struct dentry* mount_pseudo ( struct file_system_type fs_type,
char name,
const struct super_operations ops,
const struct dentry_operations dops,
unsigned long  magic 
)
read

Definition at line 221 of file libfs.c.

int noop_fsync ( struct file file,
loff_t  start,
loff_t  end,
int  datasync 
)

Definition at line 977 of file libfs.c.

int simple_attr_open ( struct inode inode,
struct file file,
int(*)(void *, u64 *)  get,
int(*)(void *, u64 set,
const char fmt 
)

Definition at line 750 of file libfs.c.

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

Definition at line 778 of file libfs.c.

int simple_attr_release ( struct inode inode,
struct file file 
)

Definition at line 771 of file libfs.c.

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

Definition at line 813 of file libfs.c.

int simple_empty ( struct dentry dentry)

Definition at line 286 of file libfs.c.

int simple_fill_super ( struct super_block s,
unsigned long  magic,
struct tree_descr files 
)

Definition at line 474 of file libfs.c.

int simple_getattr ( struct vfsmount mnt,
struct dentry dentry,
struct kstat stat 
)

Definition at line 26 of file libfs.c.

int simple_link ( struct dentry old_dentry,
struct inode dir,
struct dentry dentry 
)

Definition at line 274 of file libfs.c.

struct dentry* simple_lookup ( struct inode dir,
struct dentry dentry,
unsigned int  flags 
)
read

Definition at line 56 of file libfs.c.

int simple_open ( struct inode inode,
struct file file 
)

Definition at line 267 of file libfs.c.

int simple_pin_fs ( struct file_system_type type,
struct vfsmount **  mount,
int count 
)

Definition at line 539 of file libfs.c.

ssize_t simple_read_from_buffer ( void __user to,
size_t  count,
loff_t *  ppos,
const void from,
size_t  available 
)

simple_read_from_buffer - copy data from the buffer to user space : the user space buffer to read to : the maximum number of bytes to read : the current position in the buffer : the buffer to read from : the size of the buffer

The simple_read_from_buffer() function reads up to bytes from the buffer at offset into the user space address starting at .

On success, the number of bytes read is returned and the offset is advanced by this number, or negative value is returned on error.

Definition at line 584 of file libfs.c.

int simple_readpage ( struct file file,
struct page page 
)

Definition at line 386 of file libfs.c.

void simple_release_fs ( struct vfsmount **  mount,
int count 
)

Definition at line 559 of file libfs.c.

int simple_rename ( struct inode old_dir,
struct dentry old_dentry,
struct inode new_dir,
struct dentry new_dentry 
)

Definition at line 327 of file libfs.c.

int simple_rmdir ( struct inode dir,
struct dentry dentry 
)

Definition at line 316 of file libfs.c.

int simple_setattr ( struct dentry dentry,
struct iattr iattr 
)

simple_setattr - setattr for simple filesystem : dentry : iattr structure

Returns 0 on success, -error on failure.

simple_setattr is a simple ->setattr implementation without a proper implementation of size changes.

It can either be used for in-memory filesystems or special files on simple regular filesystems. Anything that needs to change on-disk or wire state on size changes needs its own setattr method.

Definition at line 367 of file libfs.c.

int simple_statfs ( struct dentry dentry,
struct kstatfs buf 
)

Definition at line 35 of file libfs.c.

char* simple_transaction_get ( struct file file,
const char __user buf,
size_t  size 
)

Definition at line 690 of file libfs.c.

ssize_t simple_transaction_read ( struct file file,
char __user buf,
size_t  size,
loff_t *  pos 
)

Definition at line 721 of file libfs.c.

int simple_transaction_release ( struct inode inode,
struct file file 
)

Definition at line 730 of file libfs.c.

void simple_transaction_set ( struct file file,
size_t  n 
)

Definition at line 676 of file libfs.c.

int simple_unlink ( struct inode dir,
struct dentry dentry 
)

Definition at line 306 of file libfs.c.

int simple_write_begin ( struct file file,
struct address_space mapping,
loff_t  pos,
unsigned  len,
unsigned  flags,
struct page **  pagep,
void **  fsdata 
)

Definition at line 395 of file libfs.c.

int simple_write_end ( struct file file,
struct address_space mapping,
loff_t  pos,
unsigned  len,
unsigned  copied,
struct page page,
void fsdata 
)

Definition at line 439 of file libfs.c.

ssize_t simple_write_to_buffer ( void to,
size_t  available,
loff_t *  ppos,
const void __user from,
size_t  count 
)

simple_write_to_buffer - copy data from user space to the buffer : the buffer to write to : the size of the buffer : the current position in the buffer : the user space buffer to read from : the maximum number of bytes to read

The simple_write_to_buffer() function reads up to bytes from the user space address starting at into the buffer at offset .

On success, the number of bytes written is returned and the offset is advanced by this number, or negative value is returned on error.

Definition at line 618 of file libfs.c.

Variable Documentation

struct inode_operations simple_dir_inode_operations
Initial value:
= {
.lookup = simple_lookup,
}

Definition at line 209 of file libfs.c.

struct file_operations simple_dir_operations
Initial value:
= {
.open = dcache_dir_open,
.release = dcache_dir_close,
.llseek = dcache_dir_lseek,
.readdir = dcache_readdir,
.fsync = noop_fsync,
}

Definition at line 200 of file libfs.c.