Barrelfish
Macros | Typedefs | Functions
nfs.h File Reference

NFS client definitions. More...

Macros

#define NFS_READDIR_COOKIE   0
 initial cookie for readdir
 
#define NFS_READDIR_COOKIEVERF   NULL
 initial cookie verifier for readder
 

Typedefs

typedef void(* nfs_mount_callback_t) (void *arg, struct nfs_client *client, enum mountstat3 mountstat, struct nfs_fh3 fhandle)
 Callback function for mount operation. More...
 
typedef void(* nfs_getattr_callback_t) (void *arg, struct nfs_client *client, GETATTR3res *result)
 Callback function for getattr operation. More...
 
typedef void(* nfs_setattr_callback_t) (void *arg, struct nfs_client *client, SETATTR3res *result)
 Callback function for setattr operation. More...
 
typedef void(* nfs_readdir_callback_t) (void *arg, struct nfs_client *client, READDIR3res *result)
 Callback function for readdir operation. More...
 
typedef void(* nfs_readdirplus_callback_t) (void *arg, struct nfs_client *client, READDIRPLUS3res *result)
 Callback function for readdirplus operation. More...
 
typedef void(* nfs_lookup_callback_t) (void *arg, struct nfs_client *client, LOOKUP3res *result)
 Callback function for lookup operation. More...
 
typedef void(* nfs_access_callback_t) (void *arg, struct nfs_client *client, ACCESS3res *result)
 Callback function for access operation. More...
 
typedef void(* nfs_read_callback_t) (void *arg, struct nfs_client *client, READ3res *result)
 Callback function for read operation. More...
 
typedef void(* nfs_write_callback_t) (void *arg, struct nfs_client *client, WRITE3res *result)
 Callback function for write operation. More...
 
typedef void(* nfs_create_callback_t) (void *arg, struct nfs_client *client, CREATE3res *result)
 Callback function for create operation. More...
 
typedef void(* nfs_mkdir_callback_t) (void *arg, struct nfs_client *client, MKDIR3res *result)
 Callback function for mkdir operation. More...
 
typedef void(* nfs_remove_callback_t) (void *arg, struct nfs_client *client, REMOVE3res *result)
 Callback function for remove operation. More...
 

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 definitions.

Typedef Documentation

typedef void(* nfs_access_callback_t) (void *arg, struct nfs_client *client, ACCESS3res *result)

Callback function for access operation.

Parameters
argOpaque argument pointer, as provided to nfs_access()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_create_callback_t) (void *arg, struct nfs_client *client, CREATE3res *result)

Callback function for create operation.

Parameters
argOpaque argument pointer, as provided to nfs_create()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_getattr_callback_t) (void *arg, struct nfs_client *client, GETATTR3res *result)

Callback function for getattr operation.

Parameters
argOpaque argument pointer, as provided to nfs_getattr()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_lookup_callback_t) (void *arg, struct nfs_client *client, LOOKUP3res *result)

Callback function for lookup operation.

Parameters
argOpaque argument pointer, as provided to nfs_lookup()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_mkdir_callback_t) (void *arg, struct nfs_client *client, MKDIR3res *result)

Callback function for mkdir operation.

Parameters
argOpaque argument pointer, as provided to nfs_mkdir()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_mount_callback_t) (void *arg, struct nfs_client *client, enum mountstat3 mountstat, struct nfs_fh3 fhandle)

Callback function for mount operation.

Parameters
argOpaque argument pointer, as provided to nfs_mount()
clientNFS client instance
mountstatMount status (MNT3_OK on success)
fhandleFile handle for mount point (only valid if mountstat==MNT3_OK)

The memory referred to by #fhandle, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_read_callback_t) (void *arg, struct nfs_client *client, READ3res *result)

Callback function for read operation.

Parameters
argOpaque argument pointer, as provided to nfs_read()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_readdir_callback_t) (void *arg, struct nfs_client *client, READDIR3res *result)

Callback function for readdir operation.

Parameters
argOpaque argument pointer, as provided to nfs_readdir()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_readdirplus_callback_t) (void *arg, struct nfs_client *client, READDIRPLUS3res *result)

Callback function for readdirplus operation.

Parameters
argOpaque argument pointer, as provided to nfs_readdirplus()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_remove_callback_t) (void *arg, struct nfs_client *client, REMOVE3res *result)

Callback function for remove operation.

Parameters
argOpaque argument pointer, as provided to nfs_remove()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_setattr_callback_t) (void *arg, struct nfs_client *client, SETATTR3res *result)

Callback function for setattr operation.

Parameters
argOpaque argument pointer, as provided to nfs_setattr()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

typedef void(* nfs_write_callback_t) (void *arg, struct nfs_client *client, WRITE3res *result)

Callback function for write operation.

Parameters
argOpaque argument pointer, as provided to nfs_write()
clientNFS client instance
resultResult pointer, or NULL on error

The memory referred to by #result, if any, is now the property of the callee, and must be freed by the appropriate XDR free operations.

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