Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
fuse_i.h File Reference
#include <linux/fuse.h>
#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/backing-dev.h>
#include <linux/mutex.h>
#include <linux/rwsem.h>
#include <linux/rbtree.h>
#include <linux/poll.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  fuse_forget_link
 
struct  fuse_inode
 
struct  fuse_file
 
struct  fuse_in_arg
 
struct  fuse_in
 
struct  fuse_arg
 
struct  fuse_out
 
struct  fuse_req
 
struct  fuse_conn
 

Macros

#define FUSE_MAX_PAGES_PER_REQ   32
 
#define FUSE_NOWRITE   INT_MIN
 
#define FUSE_NAME_MAX   1024
 
#define FUSE_CTL_NUM_DENTRIES   5
 
#define FUSE_DEFAULT_PERMISSIONS   (1 << 0)
 
#define FUSE_ALLOW_OTHER   (1 << 1)
 

Enumerations

enum  fuse_req_state {
  FUSE_REQ_INIT = 0, FUSE_REQ_PENDING, FUSE_REQ_READING, FUSE_REQ_SENT,
  FUSE_REQ_WRITING, FUSE_REQ_FINISHED
}
 

Functions

int fuse_inode_eq (struct inode *inode, void *_nodeidp)
 
struct inodefuse_iget (struct super_block *sb, u64 nodeid, int generation, struct fuse_attr *attr, u64 attr_valid, u64 attr_version)
 
int fuse_lookup_name (struct super_block *sb, u64 nodeid, struct qstr *name, struct fuse_entry_out *outarg, struct inode **inode)
 
void fuse_queue_forget (struct fuse_conn *fc, struct fuse_forget_link *forget, u64 nodeid, u64 nlookup)
 
struct fuse_forget_linkfuse_alloc_forget (void)
 
void fuse_read_fill (struct fuse_req *req, struct file *file, loff_t pos, size_t count, int opcode)
 
int fuse_open_common (struct inode *inode, struct file *file, bool isdir)
 
struct fuse_filefuse_file_alloc (struct fuse_conn *fc)
 
struct fuse_filefuse_file_get (struct fuse_file *ff)
 
void fuse_file_free (struct fuse_file *ff)
 
void fuse_finish_open (struct inode *inode, struct file *file)
 
void fuse_sync_release (struct fuse_file *ff, int flags)
 
void fuse_release_common (struct file *file, int opcode)
 
int fuse_fsync_common (struct file *file, loff_t start, loff_t end, int datasync, int isdir)
 
int fuse_notify_poll_wakeup (struct fuse_conn *fc, struct fuse_notify_poll_wakeup_out *outarg)
 
void fuse_init_file_inode (struct inode *inode)
 
void fuse_init_common (struct inode *inode)
 
void fuse_init_dir (struct inode *inode)
 
void fuse_init_symlink (struct inode *inode)
 
void fuse_change_attributes (struct inode *inode, struct fuse_attr *attr, u64 attr_valid, u64 attr_version)
 
void fuse_change_attributes_common (struct inode *inode, struct fuse_attr *attr, u64 attr_valid)
 
int fuse_dev_init (void)
 
void fuse_dev_cleanup (void)
 
int fuse_ctl_init (void)
 
void fuse_ctl_cleanup (void)
 
struct fuse_reqfuse_request_alloc (void)
 
struct fuse_reqfuse_request_alloc_nofs (void)
 
void fuse_request_free (struct fuse_req *req)
 
struct fuse_reqfuse_get_req (struct fuse_conn *fc)
 
struct fuse_reqfuse_get_req_nofail (struct fuse_conn *fc, struct file *file)
 
void fuse_put_request (struct fuse_conn *fc, struct fuse_req *req)
 
void fuse_request_send (struct fuse_conn *fc, struct fuse_req *req)
 
void fuse_request_send_background (struct fuse_conn *fc, struct fuse_req *req)
 
void fuse_request_send_background_locked (struct fuse_conn *fc, struct fuse_req *req)
 
void fuse_abort_conn (struct fuse_conn *fc)
 
void fuse_invalidate_attr (struct inode *inode)
 
void fuse_invalidate_entry_cache (struct dentry *entry)
 
struct fuse_connfuse_conn_get (struct fuse_conn *fc)
 
void fuse_conn_kill (struct fuse_conn *fc)
 
void fuse_conn_init (struct fuse_conn *fc)
 
void fuse_conn_put (struct fuse_conn *fc)
 
int fuse_ctl_add_conn (struct fuse_conn *fc)
 
void fuse_ctl_remove_conn (struct fuse_conn *fc)
 
int fuse_valid_type (int m)
 
int fuse_allow_task (struct fuse_conn *fc, struct task_struct *task)
 
u64 fuse_lock_owner_id (struct fuse_conn *fc, fl_owner_t id)
 
int fuse_update_attributes (struct inode *inode, struct kstat *stat, struct file *file, bool *refreshed)
 
void fuse_flush_writepages (struct inode *inode)
 
void fuse_set_nowrite (struct inode *inode)
 
void fuse_release_nowrite (struct inode *inode)
 
u64 fuse_get_attr_version (struct fuse_conn *fc)
 
int fuse_reverse_inval_inode (struct super_block *sb, u64 nodeid, loff_t offset, loff_t len)
 
int fuse_reverse_inval_entry (struct super_block *sb, u64 parent_nodeid, u64 child_nodeid, struct qstr *name)
 
int fuse_do_open (struct fuse_conn *fc, u64 nodeid, struct file *file, bool isdir)
 
ssize_t fuse_direct_io (struct file *file, const char __user *buf, size_t count, loff_t *ppos, int write)
 
long fuse_do_ioctl (struct file *file, unsigned int cmd, unsigned long arg, unsigned int flags)
 
long fuse_ioctl_common (struct file *file, unsigned int cmd, unsigned long arg, unsigned int flags)
 
unsigned fuse_file_poll (struct file *file, poll_table *wait)
 
int fuse_dev_release (struct inode *inode, struct file *file)
 
void fuse_write_update_size (struct inode *inode, loff_t pos)
 

Variables

struct list_head fuse_conn_list
 
struct mutex fuse_mutex
 
unsigned max_user_bgreq
 
unsigned max_user_congthresh
 
struct file_operations fuse_dev_operations
 
struct dentry_operations fuse_dentry_operations
 

Macro Definition Documentation

#define FUSE_ALLOW_OTHER   (1 << 1)

If the FUSE_ALLOW_OTHER flag is given, then not only the user doing the mount will be allowed to access the filesystem

Definition at line 45 of file fuse_i.h.

#define FUSE_CTL_NUM_DENTRIES   5

Number of dentries for each connection in the control filesystem

Definition at line 36 of file fuse_i.h.

#define FUSE_DEFAULT_PERMISSIONS   (1 << 0)

If the FUSE_DEFAULT_PERMISSIONS flag is given, the filesystem module will check permissions based on the file mode. Otherwise no permission checking is done in the kernel

Definition at line 41 of file fuse_i.h.

#define FUSE_MAX_PAGES_PER_REQ   32

Max number of pages that can be used in a single read request

Definition at line 27 of file fuse_i.h.

#define FUSE_NAME_MAX   1024

It could be as large as PATH_MAX, but would that have any uses?

Definition at line 33 of file fuse_i.h.

#define FUSE_NOWRITE   INT_MIN

Bias for fi->writectr, meaning new writepages must not be sent

Definition at line 30 of file fuse_i.h.

Enumeration Type Documentation

The request state

Enumerator:
FUSE_REQ_INIT 
FUSE_REQ_PENDING 
FUSE_REQ_READING 
FUSE_REQ_SENT 
FUSE_REQ_WRITING 
FUSE_REQ_FINISHED 

Definition at line 204 of file fuse_i.h.

Function Documentation

void fuse_abort_conn ( struct fuse_conn fc)

Definition at line 2009 of file dev.c.

struct fuse_forget_link* fuse_alloc_forget ( void  )
read

Definition at line 74 of file inode.c.

int fuse_allow_task ( struct fuse_conn fc,
struct task_struct task 
)

Is task allowed to perform filesystem operation?

Definition at line 999 of file dir.c.

void fuse_change_attributes ( struct inode inode,
struct fuse_attr attr,
u64  attr_valid,
u64  attr_version 
)

Change attributes of an inode

Definition at line 194 of file inode.c.

void fuse_change_attributes_common ( struct inode inode,
struct fuse_attr attr,
u64  attr_valid 
)

Definition at line 155 of file inode.c.

struct fuse_conn* fuse_conn_get ( struct fuse_conn fc)
read

Acquire reference to fuse_conn

Definition at line 596 of file inode.c.

void fuse_conn_init ( struct fuse_conn fc)

Initialize fuse_conn

Definition at line 556 of file inode.c.

void fuse_conn_kill ( struct fuse_conn fc)

Definition at line 359 of file inode.c.

void fuse_conn_put ( struct fuse_conn fc)

Release reference to fuse_conn

Definition at line 585 of file inode.c.

int fuse_ctl_add_conn ( struct fuse_conn fc)

Add connection to control filesystem

Definition at line 238 of file control.c.

void fuse_ctl_cleanup ( void  )

Definition at line 350 of file control.c.

int fuse_ctl_init ( void  )

Definition at line 345 of file control.c.

void fuse_ctl_remove_conn ( struct fuse_conn fc)

Remove connection from control filesystem

Definition at line 277 of file control.c.

void fuse_dev_cleanup ( void  )

Cleanup the client device

Definition at line 2096 of file dev.c.

int fuse_dev_init ( void  )

Initialize the client device

Definition at line 2075 of file dev.c.

int fuse_dev_release ( struct inode inode,
struct file file 
)

Definition at line 2026 of file dev.c.

ssize_t fuse_direct_io ( struct file file,
const char __user buf,
size_t  count,
loff_t *  ppos,
int  write 
)

Definition at line 1065 of file file.c.

long fuse_do_ioctl ( struct file file,
unsigned int  cmd,
unsigned long  arg,
unsigned int  flags 
)

Definition at line 1797 of file file.c.

int fuse_do_open ( struct fuse_conn fc,
u64  nodeid,
struct file file,
bool  isdir 
)

Definition at line 140 of file file.c.

struct fuse_file* fuse_file_alloc ( struct fuse_conn fc)
read

Definition at line 51 of file file.c.

void fuse_file_free ( struct fuse_file ff)

Definition at line 78 of file file.c.

struct fuse_file* fuse_file_get ( struct fuse_file ff)
read

Definition at line 84 of file file.c.

unsigned fuse_file_poll ( struct file file,
poll_table wait 
)

Definition at line 2056 of file file.c.

void fuse_finish_open ( struct inode inode,
struct file file 
)

Definition at line 170 of file file.c.

void fuse_flush_writepages ( struct inode inode)

Definition at line 1235 of file file.c.

int fuse_fsync_common ( struct file file,
loff_t  start,
loff_t  end,
int  datasync,
int  isdir 
)

Send FSYNC or FSYNCDIR request

Definition at line 406 of file file.c.

u64 fuse_get_attr_version ( struct fuse_conn fc)

Definition at line 133 of file dir.c.

struct fuse_req* fuse_get_req ( struct fuse_conn fc)
read

Get a request, may fail with -ENOMEM

Definition at line 100 of file dev.c.

struct fuse_req* fuse_get_req_nofail ( struct fuse_conn fc,
struct file file 
)
read

Gets a requests for a file operation, always succeeds

Definition at line 189 of file dev.c.

struct inode* fuse_iget ( struct super_block sb,
u64  nodeid,
int  generation,
struct fuse_attr attr,
u64  attr_valid,
u64  attr_version 
)
read

Get a filled in inode

Definition at line 276 of file inode.c.

void fuse_init_common ( struct inode inode)

Initialize inode operations on regular files and special files

Definition at line 1729 of file dir.c.

void fuse_init_dir ( struct inode inode)

Initialize inode and file operations on a directory

Definition at line 1734 of file dir.c.

void fuse_init_file_inode ( struct inode inode)

Initialize file operations on a regular file

Definition at line 2266 of file file.c.

void fuse_init_symlink ( struct inode inode)

Initialize inode operations on a symlink

Definition at line 1740 of file dir.c.

int fuse_inode_eq ( struct inode inode,
void _nodeidp 
)

Inode to nodeid comparison.

Definition at line 260 of file inode.c.

void fuse_invalidate_attr ( struct inode inode)

Invalidate inode attributes

Definition at line 87 of file dir.c.

void fuse_invalidate_entry_cache ( struct dentry entry)

Definition at line 100 of file dir.c.

long fuse_ioctl_common ( struct file file,
unsigned int  cmd,
unsigned long  arg,
unsigned int  flags 
)

Definition at line 1978 of file file.c.

u64 fuse_lock_owner_id ( struct fuse_conn fc,
fl_owner_t  id 
)

Definition at line 295 of file file.c.

int fuse_lookup_name ( struct super_block sb,
u64  nodeid,
struct qstr name,
struct fuse_entry_out outarg,
struct inode **  inode 
)

Definition at line 260 of file dir.c.

int fuse_notify_poll_wakeup ( struct fuse_conn fc,
struct fuse_notify_poll_wakeup_out outarg 
)

Notify poll wakeup

Definition at line 2109 of file file.c.

int fuse_open_common ( struct inode inode,
struct file file,
bool  isdir 
)

Send OPEN or OPENDIR request

Definition at line 192 of file file.c.

void fuse_put_request ( struct fuse_conn fc,
struct fuse_req req 
)

Decrement reference count of a request. If count goes to zero free the request.

Definition at line 204 of file dev.c.

void fuse_queue_forget ( struct fuse_conn fc,
struct fuse_forget_link forget,
u64  nodeid,
u64  nlookup 
)

Send FORGET command

Definition at line 253 of file dev.c.

void fuse_read_fill ( struct fuse_req req,
struct file file,
loff_t  pos,
size_t  count,
int  opcode 
)

Initialize READ or READDIR request

Definition at line 474 of file file.c.

void fuse_release_common ( struct file file,
int  opcode 
)

Send RELEASE or RELEASEDIR request

Definition at line 233 of file file.c.

void fuse_release_nowrite ( struct inode inode)

Definition at line 1365 of file dir.c.

struct fuse_req* fuse_request_alloc ( void  )
read

Allocate a request

Definition at line 46 of file dev.c.

struct fuse_req* fuse_request_alloc_nofs ( void  )
read

Definition at line 55 of file dev.c.

void fuse_request_free ( struct fuse_req req)

Free a request

Definition at line 63 of file dev.c.

void fuse_request_send ( struct fuse_conn fc,
struct fuse_req req 
)

Send a request (synchronous)

Definition at line 409 of file dev.c.

void fuse_request_send_background ( struct fuse_conn fc,
struct fuse_req req 
)

Send a request in the background

Definition at line 458 of file dev.c.

void fuse_request_send_background_locked ( struct fuse_conn fc,
struct fuse_req req 
)

Definition at line 487 of file dev.c.

int fuse_reverse_inval_entry ( struct super_block sb,
u64  parent_nodeid,
u64  child_nodeid,
struct qstr name 
)

File-system tells the kernel to invalidate parent attributes and the dentry matching parent/name.

If the child_nodeid is non-zero and:

  • matches the inode number for the dentry matching parent/name,
  • is not a mount point
  • is a file or oan empty directory then the dentry is unhashed (d_delete()).

Definition at line 921 of file dir.c.

int fuse_reverse_inval_inode ( struct super_block sb,
u64  nodeid,
loff_t  offset,
loff_t  len 
)

File-system tells the kernel to invalidate cache for the given node id.

Definition at line 311 of file inode.c.

void fuse_set_nowrite ( struct inode inode)

Definition at line 1336 of file dir.c.

void fuse_sync_release ( struct fuse_file ff,
int  flags 
)

Definition at line 280 of file file.c.

int fuse_update_attributes ( struct inode inode,
struct kstat stat,
struct file file,
bool refreshed 
)

Definition at line 895 of file dir.c.

int fuse_valid_type ( int  m)

Is file type valid?

Definition at line 234 of file dir.c.

void fuse_write_update_size ( struct inode inode,
loff_t  pos 
)

Definition at line 764 of file file.c.

Variable Documentation

struct list_head fuse_conn_list

List of active connections

Definition at line 29 of file inode.c.

struct dentry_operations fuse_dentry_operations

Definition at line 230 of file dir.c.

struct file_operations fuse_dev_operations

Device operations

Definition at line 2054 of file dev.c.

struct mutex fuse_mutex

Global mutex protecting fuse_conn_list and the control filesystem

unsigned max_user_bgreq

Module parameters

Definition at line 34 of file inode.c.

unsigned max_user_congthresh

Definition at line 42 of file inode.c.