Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
inode.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/unistd.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/stats.h>
#include <linux/sunrpc/metrics.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_mount.h>
#include <linux/nfs4_mount.h>
#include <linux/lockd/bind.h>
#include <linux/seq_file.h>
#include <linux/mount.h>
#include <linux/vfs.h>
#include <linux/inet.h>
#include <linux/nfs_xdr.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <linux/freezer.h>
#include <linux/crc32.h>
#include <asm/uaccess.h>
#include "nfs4_fs.h"
#include "callback.h"
#include "delegation.h"
#include "iostat.h"
#include "internal.h"
#include "fscache.h"
#include "dns_resolve.h"
#include "pnfs.h"
#include "nfs.h"
#include "netns.h"

Go to the source code of this file.

Data Structures

struct  nfs_find_desc
 

Macros

#define NFSDBG_FACILITY   NFSDBG_VFS
 
#define NFS_64_BIT_INODE_NUMBERS_ENABLED   1
 
#define NFS_VALID_ATTRS   (ATTR_MODE|ATTR_UID|ATTR_GID|ATTR_SIZE|ATTR_ATIME|ATTR_ATIME_SET|ATTR_MTIME|ATTR_MTIME_SET|ATTR_FILE|ATTR_OPEN)
 

Functions

int nfs_wait_bit_killable (void *word)
 
 EXPORT_SYMBOL_GPL (nfs_wait_bit_killable)
 
u64 nfs_compat_user_ino64 (u64 fileid)
 
void nfs_clear_inode (struct inode *inode)
 
 EXPORT_SYMBOL_GPL (nfs_clear_inode)
 
void nfs_evict_inode (struct inode *inode)
 
int nfs_sync_mapping (struct address_space *mapping)
 
void nfs_zap_caches (struct inode *inode)
 
void nfs_zap_mapping (struct inode *inode, struct address_space *mapping)
 
void nfs_zap_acl_cache (struct inode *inode)
 
 EXPORT_SYMBOL_GPL (nfs_zap_acl_cache)
 
void nfs_invalidate_atime (struct inode *inode)
 
 EXPORT_SYMBOL_GPL (nfs_invalidate_atime)
 
struct inodenfs_fhget (struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
 
 EXPORT_SYMBOL_GPL (nfs_fhget)
 
int nfs_setattr (struct dentry *dentry, struct iattr *attr)
 
 EXPORT_SYMBOL_GPL (nfs_setattr)
 
void nfs_setattr_update_inode (struct inode *inode, struct iattr *attr)
 
 EXPORT_SYMBOL_GPL (nfs_setattr_update_inode)
 
int nfs_getattr (struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
 
 EXPORT_SYMBOL_GPL (nfs_getattr)
 
struct nfs_lock_contextnfs_get_lock_context (struct nfs_open_context *ctx)
 
void nfs_put_lock_context (struct nfs_lock_context *l_ctx)
 
void nfs_close_context (struct nfs_open_context *ctx, int is_sync)
 
 EXPORT_SYMBOL_GPL (nfs_close_context)
 
struct nfs_open_contextalloc_nfs_open_context (struct dentry *dentry, fmode_t f_mode)
 
 EXPORT_SYMBOL_GPL (alloc_nfs_open_context)
 
struct nfs_open_contextget_nfs_open_context (struct nfs_open_context *ctx)
 
 EXPORT_SYMBOL_GPL (get_nfs_open_context)
 
void put_nfs_open_context (struct nfs_open_context *ctx)
 
 EXPORT_SYMBOL_GPL (put_nfs_open_context)
 
void nfs_file_set_open_context (struct file *filp, struct nfs_open_context *ctx)
 
 EXPORT_SYMBOL_GPL (nfs_file_set_open_context)
 
struct nfs_open_contextnfs_find_open_context (struct inode *inode, struct rpc_cred *cred, fmode_t mode)
 
int nfs_open (struct inode *inode, struct file *filp)
 
int nfs_release (struct inode *inode, struct file *filp)
 
int __nfs_revalidate_inode (struct nfs_server *server, struct inode *inode)
 
int nfs_attribute_timeout (struct inode *inode)
 
int nfs_revalidate_inode (struct nfs_server *server, struct inode *inode)
 
 EXPORT_SYMBOL_GPL (nfs_revalidate_inode)
 
int nfs_revalidate_mapping (struct inode *inode, struct address_space *mapping)
 
unsigned long nfs_inc_attr_generation_counter (void)
 
void nfs_fattr_init (struct nfs_fattr *fattr)
 
 EXPORT_SYMBOL_GPL (nfs_fattr_init)
 
struct nfs_fattrnfs_alloc_fattr (void)
 
 EXPORT_SYMBOL_GPL (nfs_alloc_fattr)
 
struct nfs_fhnfs_alloc_fhandle (void)
 
 EXPORT_SYMBOL_GPL (nfs_alloc_fhandle)
 
int nfs_refresh_inode (struct inode *inode, struct nfs_fattr *fattr)
 
 EXPORT_SYMBOL_GPL (nfs_refresh_inode)
 
int nfs_post_op_update_inode (struct inode *inode, struct nfs_fattr *fattr)
 
 EXPORT_SYMBOL_GPL (nfs_post_op_update_inode)
 
int nfs_post_op_update_inode_force_wcc (struct inode *inode, struct nfs_fattr *fattr)
 
 EXPORT_SYMBOL_GPL (nfs_post_op_update_inode_force_wcc)
 
struct inodenfs_alloc_inode (struct super_block *sb)
 
 EXPORT_SYMBOL_GPL (nfs_alloc_inode)
 
void nfs_destroy_inode (struct inode *inode)
 
 EXPORT_SYMBOL_GPL (nfs_destroy_inode)
 
 EXPORT_SYMBOL_GPL (nfsiod_workqueue)
 
 EXPORT_SYMBOL_GPL (nfs_net_id)
 
 MODULE_AUTHOR ("Olaf Kirch <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 
 module_param (enable_ino64, bool, 0644)
 

Variables

struct workqueue_structnfsiod_workqueue
 
int nfs_net_id
 

Macro Definition Documentation

#define NFS_64_BIT_INODE_NUMBERS_ENABLED   1

Definition at line 58 of file inode.c.

Definition at line 400 of file inode.c.

#define NFSDBG_FACILITY   NFSDBG_VFS

Definition at line 56 of file inode.c.

Function Documentation

int __nfs_revalidate_inode ( struct nfs_server server,
struct inode inode 
)

Definition at line 780 of file inode.c.

struct nfs_open_context* alloc_nfs_open_context ( struct dentry dentry,
fmode_t  f_mode 
)
read

Definition at line 636 of file inode.c.

EXPORT_SYMBOL_GPL ( nfs_wait_bit_killable  )
EXPORT_SYMBOL_GPL ( nfs_clear_inode  )
EXPORT_SYMBOL_GPL ( nfs_zap_acl_cache  )
EXPORT_SYMBOL_GPL ( nfs_invalidate_atime  )
EXPORT_SYMBOL_GPL ( nfs_fhget  )
EXPORT_SYMBOL_GPL ( nfs_setattr  )
EXPORT_SYMBOL_GPL ( nfs_setattr_update_inode  )
EXPORT_SYMBOL_GPL ( nfs_getattr  )
EXPORT_SYMBOL_GPL ( nfs_close_context  )
EXPORT_SYMBOL_GPL ( alloc_nfs_open_context  )
EXPORT_SYMBOL_GPL ( get_nfs_open_context  )
EXPORT_SYMBOL_GPL ( put_nfs_open_context  )
EXPORT_SYMBOL_GPL ( nfs_file_set_open_context  )
EXPORT_SYMBOL_GPL ( nfs_revalidate_inode  )
EXPORT_SYMBOL_GPL ( nfs_fattr_init  )
EXPORT_SYMBOL_GPL ( nfs_alloc_fattr  )
EXPORT_SYMBOL_GPL ( nfs_alloc_fhandle  )
EXPORT_SYMBOL_GPL ( nfs_refresh_inode  )
EXPORT_SYMBOL_GPL ( nfs_post_op_update_inode  )
EXPORT_SYMBOL_GPL ( nfs_post_op_update_inode_force_wcc  )
EXPORT_SYMBOL_GPL ( nfs_alloc_inode  )
EXPORT_SYMBOL_GPL ( nfs_destroy_inode  )
EXPORT_SYMBOL_GPL ( nfsiod_workqueue  )
EXPORT_SYMBOL_GPL ( nfs_net_id  )
struct nfs_open_context* get_nfs_open_context ( struct nfs_open_context ctx)
read

Definition at line 663 of file inode.c.

MODULE_AUTHOR ( "Olaf Kirch <[email protected]>"  )
MODULE_LICENSE ( "GPL"  )
module_param ( enable_ino64  ,
bool  ,
0644   
)
struct nfs_fattr* nfs_alloc_fattr ( void  )
read

Definition at line 1054 of file inode.c.

struct nfs_fh* nfs_alloc_fhandle ( void  )
read

Definition at line 1065 of file inode.c.

struct inode* nfs_alloc_inode ( struct super_block sb)
read

Definition at line 1502 of file inode.c.

int nfs_attribute_timeout ( struct inode inode)

Definition at line 833 of file inode.c.

void nfs_clear_inode ( struct inode inode)

Definition at line 110 of file inode.c.

void nfs_close_context ( struct nfs_open_context ctx,
int  is_sync 
)

nfs_close_context - Common close_context() routine NFSv2/v3 : pointer to context : is this a synchronous close

always ensure that the attributes are up to date if we're mounted with close-to-open semantics

Definition at line 617 of file inode.c.

u64 nfs_compat_user_ino64 ( u64  fileid)

nfs_compat_user_ino64 - returns the user-visible inode number : 64-bit fileid

This function returns a 32-bit inode number if the boot parameter nfs.enable_ino64 is zero.

Definition at line 94 of file inode.c.

void nfs_destroy_inode ( struct inode inode)

Definition at line 1527 of file inode.c.

void nfs_evict_inode ( struct inode inode)

Definition at line 123 of file inode.c.

void nfs_fattr_init ( struct nfs_fattr fattr)

Definition at line 1044 of file inode.c.

struct inode* nfs_fhget ( struct super_block sb,
struct nfs_fh fh,
struct nfs_fattr fattr 
)
read

Definition at line 254 of file inode.c.

void nfs_file_set_open_context ( struct file filp,
struct nfs_open_context ctx 
)

Definition at line 706 of file inode.c.

struct nfs_open_context* nfs_find_open_context ( struct inode inode,
struct rpc_cred *  cred,
fmode_t  mode 
)
read

Definition at line 721 of file inode.c.

struct nfs_lock_context* nfs_get_lock_context ( struct nfs_open_context ctx)
read

Definition at line 570 of file inode.c.

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

Definition at line 507 of file inode.c.

unsigned long nfs_inc_attr_generation_counter ( void  )

Definition at line 1039 of file inode.c.

void nfs_invalidate_atime ( struct inode inode)

Definition at line 193 of file inode.c.

int nfs_open ( struct inode inode,
struct file filp 
)

Definition at line 756 of file inode.c.

int nfs_post_op_update_inode ( struct inode inode,
struct nfs_fattr fattr 
)

nfs_post_op_update_inode - try to update the inode attribute cache - pointer to inode - updated attributes

After an operation that has changed the inode metadata, mark the attribute cache as being invalid, then try to update it.

NB: if the server didn't return any post op attributes, this function will force the retrieval of attributes before the next NFS request. Thus it should be used only for operations that are expected to change one or more attributes, to avoid unnecessary NFS requests and trips through nfs_update_inode().

Definition at line 1223 of file inode.c.

int nfs_post_op_update_inode_force_wcc ( struct inode inode,
struct nfs_fattr fattr 
)

nfs_post_op_update_inode_force_wcc - try to update the inode attribute cache - pointer to inode - updated attributes

After an operation that has changed the inode metadata, mark the attribute cache as being invalid, then try to update it. Fake up weak cache consistency data, if none exist.

This function is mainly designed to be used by the ->write_done() functions.

Definition at line 1245 of file inode.c.

void nfs_put_lock_context ( struct nfs_lock_context l_ctx)

Definition at line 597 of file inode.c.

int nfs_refresh_inode ( struct inode inode,
struct nfs_fattr fattr 
)

nfs_refresh_inode - try to update the inode attribute cache - pointer to inode - updated attributes

Check that an RPC call that returned attributes has not overlapped with other recent updates of the inode metadata, then decide whether it is safe to do a full update of the inode attributes, or whether just to call nfs_check_inode_attributes.

Definition at line 1183 of file inode.c.

int nfs_release ( struct inode inode,
struct file filp 
)

Definition at line 769 of file inode.c.

int nfs_revalidate_inode ( struct nfs_server server,
struct inode inode 
)

nfs_revalidate_inode - Revalidate the inode attributes - pointer to nfs_server struct - pointer to inode struct

Updates inode attribute information by retrieving the data from the server.

Definition at line 854 of file inode.c.

int nfs_revalidate_mapping ( struct inode inode,
struct address_space mapping 
)

nfs_revalidate_mapping - Revalidate the pagecache - pointer to host inode - pointer to mapping

Definition at line 898 of file inode.c.

int nfs_setattr ( struct dentry dentry,
struct iattr attr 
)

Definition at line 403 of file inode.c.

void nfs_setattr_update_inode ( struct inode inode,
struct iattr attr 
)

nfs_setattr_update_inode - Update inode metadata after a setattr call. : pointer to struct inode : pointer to struct iattr

Note: we do this in the *proc.c in order to ensure that it works for things like exclusive creates too.

Definition at line 484 of file inode.c.

int nfs_sync_mapping ( struct address_space mapping)

nfs_sync_mapping - helper to flush all mmapped dirty data to disk

Definition at line 133 of file inode.c.

int nfs_wait_bit_killable ( void word)

nfs_wait_bit_killable - helper for functions that are sleeping on bit locks : long word containing the bit lock

Definition at line 78 of file inode.c.

void nfs_zap_acl_cache ( struct inode inode)

Definition at line 180 of file inode.c.

void nfs_zap_caches ( struct inode inode)

Definition at line 164 of file inode.c.

void nfs_zap_mapping ( struct inode inode,
struct address_space mapping 
)

Definition at line 171 of file inode.c.

void put_nfs_open_context ( struct nfs_open_context ctx)

Definition at line 696 of file inode.c.

Variable Documentation

int nfs_net_id

Definition at line 1616 of file inode.c.

struct workqueue_struct* nfsiod_workqueue

Definition at line 1585 of file inode.c.