Main Page | Modules | Data Structures | File List | Data Fields | Globals

PVFS2 Linux kernel support

The PVFS2 Linux kernel support allows PVFS2 volumes to be mounted and accessed through the Linux VFS (i.e. More...

Files

file  acl.c
file  dcache.c
file  dir.c
file  downcall.h
file  file.c
file  inode.c
file  namei.c
file  pvfs2-kernel.h
file  waitqueue.c
file  xattr-default.c
file  xattr-trusted.c
file  xattr.c

Data Structures

struct  pvfs2_inode_t
 per inode private pvfs2 info More...

struct  pvfs2_mount_options_t
 mount options. More...

struct  pvfs2_mount_sb_info_t
 a temporary structure used only for sb mount time that groups the mount time data provided along with a private superblock structure that is allocated before a 'kernel' superblock is allocated. More...

struct  pvfs2_opaque_handle_t
 PVFS2 specific structure that we use for constructing an opaque handle at the time an openg() system call that will be used at subsequent openfh system call We stuff in enough information into this buffer that subsequent openfh calls don't have to communicate with server. More...

struct  pvfs2_sb_info_t
 per superblock private pvfs2 info More...


Defines

#define PVFS2_OP_INTERRUPTIBLE   1
#define PVFS2_OP_PRIORITY   2
#define PVFS2_OP_CANCELLATION   4
#define PVFS2_OP_NO_SEMAPHORE   8
#define handle_io_error()

Functions

int wait_for_matching_downcall (pvfs2_kernel_op_t *op)
int wait_for_cancellation_downcall (pvfs2_kernel_op_t *op)
inode * pvfs2_get_custom_inode_common (struct super_block *sb, struct inode *dir, int mode, dev_t dev, PVFS_object_ref ref, int from_create)
int pvfs2_setattr (struct dentry *dentry, struct iattr *iattr)
int pvfs2_getattr (struct vfsmount *mnt, struct dentry *dentry, struct kstat *kstat)
int pvfs2_file_open (struct inode *inode, struct file *file)
int pvfs2_file_release (struct inode *inode, struct file *file)
int service_operation (pvfs2_kernel_op_t *op, const char *op_name, int flags)

Variables

address_space_operations pvfs2_address_operations
address_space_operations pvfs2_address_operations
inode_operations pvfs2_file_inode_operations
inode_operations pvfs2_file_inode_operations
file_operations pvfs2_file_operations
file_operations pvfs2_file_operations
inode_operations pvfs2_dir_inode_operations
inode_operations pvfs2_dir_inode_operations
file_operations pvfs2_dir_operations
file_operations pvfs2_dir_operations
dentry_operations pvfs2_dentry_operations
dentry_operations pvfs2_dentry_operations

Detailed Description

The PVFS2 Linux kernel support allows PVFS2 volumes to be mounted and accessed through the Linux VFS (i.e.

using standard I/O system calls). This support is only needed on clients that wish to mount the file system.


Define Documentation

 
#define handle_io_error  ) 
 

Value:

do {                                                      \
    if(!op_state_serviced(new_op))                        \
    {                                                     \
        pvfs2_cancel_op_in_progress(new_op->tag);         \
        op_release(new_op);                               \
    }                                                     \
    else                                                  \
    {                                                     \
        wake_up_daemon_for_return(new_op);                \
    }                                                     \
    new_op = NULL;                                        \
    pvfs_bufmap_put(buffer_index);                        \
    buffer_index = -1;                                    \
} while(0)
handles two possible error cases, depending on context.

by design, our vfs i/o errors need to be handled in one of two ways, depending on where the error occured.

if the error happens in the waitqueue code because we either timed out or a signal was raised while waiting, we need to cancel the userspace i/o operation and free the op manually. this is done to avoid having the device start writing application data to our shared bufmap pages without us expecting it.

FIXME: POSSIBLE OPTIMIZATION: However, if we timed out or if we got a signal AND our upcall was never picked off the queue (i.e. we were in OP_VFS_STATE_WAITING), then we don't need to send a cancellation upcall. The way we can handle this is set error_exit to 2 in such cases and 1 whenever cancellation has to be sent and have handle_error take care of this situation as well..

if a pvfs2 sysint level error occured and i/o has been completed, there is no need to cancel the operation, as the user has finished using the bufmap page and so there is no danger in this case. in this case, we wake up the device normally so that it may free the op, as normal.

Note:
the only reason this is a macro is because both read and write cases need the exact same handling code.

#define PVFS2_OP_CANCELLATION   4
 

this is a cancellation

#define PVFS2_OP_INTERRUPTIBLE   1
 

service_operation() is interruptible

#define PVFS2_OP_NO_SEMAPHORE   8
 

don't acquire semaphore

#define PVFS2_OP_PRIORITY   2
 

service_operation() is high priority


Function Documentation

int pvfs2_file_open struct inode *  inode,
struct file *  file
 

Called when a process requests to open a file.

int pvfs2_file_release struct inode *  inode,
struct file *  file
 

Called to notify the module that there are no more references to this file (i.e.

no processes have it open).

Note:
Not called when each file is closed.

struct inode* pvfs2_get_custom_inode_common struct super_block *  sb,
struct inode *  dir,
int  mode,
dev_t  dev,
PVFS_object_ref  ref,
int  from_create
 

Allocates a Linux inode structure with additional PVFS2-specific private data (I think -- RobR).

Here is the call graph for this function:

int pvfs2_getattr struct vfsmount *  mnt,
struct dentry *  dentry,
struct kstat *  kstat
 

Obtain attributes of an object given a dentry.

int pvfs2_setattr struct dentry *  dentry,
struct iattr *  iattr
 

Change attributes of an object referenced by dentry.

int service_operation pvfs2_kernel_op_t *  op,
const char *  op_name,
int  flags
 

submits a PVFS2 operation and waits for it to complete

Note:
op->downcall.status will contain the status of the operation (in errno format), whether provided by pvfs2-client or a result of failure to service the operation. If the caller wishes to distinguish, then op->state can be checked to see if it was serviced or not.
Returns:
contents of op->downcall.status for convenience
Parameters:
op  operation structure to process
op_name  string name for operation
flags  flags to modify behavior

Here is the call graph for this function:

int wait_for_cancellation_downcall pvfs2_kernel_op_t *  op  ) 
 

similar to wait_for_matching_downcall(), but used in the special case of I/O cancellations.

Note:
we need a special wait function because if this is called we already know that a signal is pending in current and need to service the cancellation upcall anyway. the only way to exit this is to either timeout or have the cancellation be serviced properly.

int wait_for_matching_downcall pvfs2_kernel_op_t *  op  ) 
 

sleeps on waitqueue waiting for matching downcall.

if client-core finishes servicing, then we are good to go. else if client-core exits, we get woken up here, and retry with a timeout

Postcondition:
when this call returns to the caller, the specified op will no longer be on any list or htable.
Returns:
0 on success and -errno on failure Errors are: EAGAIN in case we want the caller to requeue and try again.. EINTR/EIO/ETIMEDOUT indicating we are done trying to service this operation since client-core seems to be exiting too often or if we were interrupted.


Variable Documentation

struct address_space_operations pvfs2_address_operations
 

PVFS2 implementation of address space operations.

struct address_space_operations pvfs2_address_operations
 

Initial value:

{



    .readpage = pvfs2_readpage,
    .readpages = pvfs2_readpages,
    .invalidatepage = pvfs2_invalidatepage,
    .releasepage = pvfs2_releasepage

}
PVFS2 implementation of address space operations.

struct dentry_operations pvfs2_dentry_operations
 

PVFS2 implementation of VFS dentry operations.

struct dentry_operations pvfs2_dentry_operations
 

Initial value:

{
    .d_revalidate = pvfs2_d_revalidate,
    .d_hash = pvfs2_d_hash,
    .d_compare = pvfs2_d_compare,
    .d_delete = pvfs2_d_delete,
}
PVFS2 implementation of VFS dentry operations.

struct inode_operations pvfs2_dir_inode_operations
 

PVFS2 implementation of VFS inode operations for directories.

struct inode_operations pvfs2_dir_inode_operations
 

PVFS2 implementation of VFS inode operations for directories.

struct file_operations pvfs2_dir_operations
 

PVFS2 implementation of VFS directory operations.

struct file_operations pvfs2_dir_operations
 

Initial value:

{






    .read = generic_read_dir,
    .readdir = pvfs2_readdir,






    .open = pvfs2_file_open,
    .release = pvfs2_file_release,

}
PVFS2 implementation of VFS directory operations.

struct inode_operations pvfs2_file_inode_operations
 

PVFS2 implementation of VFS inode operations for files.

struct inode_operations pvfs2_file_inode_operations
 

PVFS2 implementation of VFS inode operations for files.

struct file_operations pvfs2_file_operations
 

PVFS2 implementation of VFS file operations.

struct file_operations pvfs2_file_operations
 

PVFS2 implementation of VFS file operations.


Generated on Sat Feb 4 02:46:20 2012 for PVFS by doxygen 1.3.5