Barrelfish
Enumerations | Functions
nfs.c File Reference

NFS client. More...

Enumerations

Functions

struct nfs_client * nfs_mount (struct ip_addr server, const char *path, nfs_mount_callback_t callback, void *cbarg)
 Initiate an NFS mount operation. More...
 
err_t nfs_getattr (struct nfs_client *client, struct nfs_fh3 fh, nfs_getattr_callback_t callback, void *cbarg)
 Initiate an NFS getattr operation. More...
 
err_t nfs_setattr (struct nfs_client *client, struct nfs_fh3 fh, sattr3 new_attributes, bool guarded, nfs_setattr_callback_t callback, void *cbarg)
 Initiate an NFS setattr operation. More...
 
err_t nfs_readdir (struct nfs_client *client, struct nfs_fh3 fh, cookie3 cookie, cookieverf3 cookieverf, nfs_readdir_callback_t callback, void *cbarg)
 Initiate an NFS readdir operation. More...
 
err_t nfs_readdirplus (struct nfs_client *client, struct nfs_fh3 fh, cookie3 cookie, cookieverf3 cookieverf, nfs_readdirplus_callback_t callback, void *cbarg)
 Initiate an NFS readdirplus operation. More...
 
err_t nfs_lookup (struct nfs_client *client, struct nfs_fh3 dirfh, const char *name, nfs_lookup_callback_t callback, void *cbarg)
 Initiate an NFS lookup operation. More...
 
err_t nfs_access (struct nfs_client *client, struct nfs_fh3 fh, uint32_t access, nfs_access_callback_t callback, void *cbarg)
 Initiate an NFS access operation. More...
 
err_t nfs_read (struct nfs_client *client, struct nfs_fh3 fh, offset3 offset, count3 count, nfs_read_callback_t callback, void *cbarg)
 Initiate an NFS read operation. More...
 
err_t nfs_write (struct nfs_client *client, struct nfs_fh3 fh, offset3 offset, const void *data, count3 count, stable_how stable, nfs_write_callback_t callback, void *cbarg)
 Initiate an NFS write operation. More...
 
err_t nfs_create (struct nfs_client *client, struct nfs_fh3 dir, const char *name, bool guarded, sattr3 attributes, nfs_create_callback_t callback, void *cbarg)
 Initiate an NFS create operation (unchecked or guarded) More...
 
err_t nfs_mkdir (struct nfs_client *client, struct nfs_fh3 dir, const char *name, sattr3 attributes, nfs_mkdir_callback_t callback, void *cbarg)
 Initiate an NFS mkdir operation. More...
 
err_t nfs_remove (struct nfs_client *client, struct nfs_fh3 dir, const char *name, nfs_remove_callback_t callback, void *cbarg)
 Initiate an NFS remove operation. More...
 
void nfs_destroy (struct nfs_client *client)
 Reclaim memory and terminate any outstanding operations.
 

Detailed Description

NFS client.

Enumeration Type Documentation

What state are we at in initialising this mount?

Enumerator
NFS_INIT_GETPORT_MOUNT 
  1. consult portmap for mountd port
NFS_INIT_GETPORT_NFS 
  1. consult portmap for nfsd port
NFS_INIT_MOUNT 
  1. call mountd to perform mount
NFS_INIT_COMPLETE 
  1. complete

Function Documentation

err_t nfs_access ( struct nfs_client *  client,
struct nfs_fh3  fh,
uint32_t  access,
nfs_access_callback_t  callback,
void *  cbarg 
)

Initiate an NFS access operation.

Parameters
clientNFS client pointer, which has completed the mount process
fhFilehandle for file/object to check access to
accessRights to check for
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_create ( struct nfs_client *  client,
struct nfs_fh3  dir,
const char *  name,
bool  guarded,
sattr3  attributes,
nfs_create_callback_t  callback,
void *  cbarg 
)

Initiate an NFS create operation (unchecked or guarded)

Parameters
clientNFS client pointer, which has completed the mount process
dirFilehandle for directory in which to create file
nameName of file to create
guardedTrue iff the operation should fail if the file already exists
attributesInitial attributes for the file
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_getattr ( struct nfs_client *  client,
struct nfs_fh3  fh,
nfs_getattr_callback_t  callback,
void *  cbarg 
)

Initiate an NFS getattr operation.

Parameters
clientNFS client pointer, which has completed the mount process
fhFilehandle for directory to stat
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_lookup ( struct nfs_client *  client,
struct nfs_fh3  dirfh,
const char *  name,
nfs_lookup_callback_t  callback,
void *  cbarg 
)

Initiate an NFS lookup operation.

Parameters
clientNFS client pointer, which has completed the mount process
dirfhFilehandle for directory to lookup
nameName to lookup
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_mkdir ( struct nfs_client *  client,
struct nfs_fh3  dir,
const char *  name,
sattr3  attributes,
nfs_mkdir_callback_t  callback,
void *  cbarg 
)

Initiate an NFS mkdir operation.

Parameters
clientNFS client pointer, which has completed the mount process
dirFilehandle for directory in which to create directory
nameName of directory to create
attributesInitial attributes for the directory
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
struct nfs_client* nfs_mount ( struct ip_addr  server,
const char *  path,
nfs_mount_callback_t  callback,
void *  cbarg 
)

Initiate an NFS mount operation.

Parameters
serverIP address of NFSv3 server
pathPath on server to mount
callbackCallback function to call when mount completes or fails
cbargOpaque argument word passed to callback function
Returns
nfs_client instance pointer on success, or NULL on error. If this call succeeds, the returned client instance must be freed by a later call to nfs_destroy().
err_t nfs_read ( struct nfs_client *  client,
struct nfs_fh3  fh,
offset3  offset,
count3  count,
nfs_read_callback_t  callback,
void *  cbarg 
)

Initiate an NFS read operation.

Parameters
clientNFS client pointer, which has completed the mount process
fhFilehandle for file to read
offsetOffset from start of file to read from
countMaximum number of bytes to read
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_readdir ( struct nfs_client *  client,
struct nfs_fh3  fh,
cookie3  cookie,
cookieverf3  cookieverf,
nfs_readdir_callback_t  callback,
void *  cbarg 
)

Initiate an NFS readdir operation.

Parameters
clientNFS client pointer, which has completed the mount process
fhFilehandle for directory to read
cookieCookie from a previous call, or NFS_READDIR_COOKIE for a new call
cookieverfCookie verifier from a previous call, or NFS_READDIR_COOKIEVERF
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_readdirplus ( struct nfs_client *  client,
struct nfs_fh3  fh,
cookie3  cookie,
cookieverf3  cookieverf,
nfs_readdirplus_callback_t  callback,
void *  cbarg 
)

Initiate an NFS readdirplus operation.

Parameters
clientNFS client pointer, which has completed the mount process
fhFilehandle for directory to read
cookieCookie from a previous call, or NFS_READDIR_COOKIE for a new call
cookieverfCookie verifier from a previous call, or NFS_READDIR_COOKIEVERF
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_remove ( struct nfs_client *  client,
struct nfs_fh3  dir,
const char *  name,
nfs_remove_callback_t  callback,
void *  cbarg 
)

Initiate an NFS remove operation.

Parameters
clientNFS client pointer, which has completed the mount process
dirFilehandle for directory in which to remove file
nameName of file to remove
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_setattr ( struct nfs_client *  client,
struct nfs_fh3  fh,
sattr3  new_attributes,
bool  guarded,
nfs_setattr_callback_t  callback,
void *  cbarg 
)

Initiate an NFS setattr operation.

Parameters
clientNFS client pointer, which has completed the mount process
fhFilehandle for directory which attributes are to be modified
newNew attributes for directory
guardedTODO
ctimeTODO
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure
err_t nfs_write ( struct nfs_client *  client,
struct nfs_fh3  fh,
offset3  offset,
const void *  data,
count3  count,
stable_how  stable,
nfs_write_callback_t  callback,
void *  cbarg 
)

Initiate an NFS write operation.

Parameters
clientNFS client pointer, which has completed the mount process
fhFilehandle for file to write
offsetOffset from start of file to write from
dataPointer to data to write
countNumber of bytes of data to write
stableSpecifies when the server may commit data to stable storage
callbackCallback function to call when operation returns
cbargOpaque argument word passed to callback function
Returns
ERR_OK on success, error code on failure