Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

puffs_flush(3) [netbsd man page]

PUFFS_FLUSH(3)						   BSD Library Functions Manual 					    PUFFS_FLUSH(3)

NAME
puffs_flush -- puffs kernel cache flushing and invalidation routines LIBRARY
puffs Convenience Library (libpuffs, -lpuffs) SYNOPSIS
#include <puffs.h> int puffs_inval_namecache_dir(struct puffs_usermount *pu, puffs_cookie_t cookie); int puffs_inval_namecache_all(struct puffs_usermount *pu); int puffs_inval_pagecache_node(struct puffs_usermount *pu, puffs_cookie_t cookie); int puffs_inval_pagecache_node_range(struct puffs_usermount *pu, puffs_cookie_t cookie, off_t start, off_t end); int puffs_flush_pagecache_node(struct puffs_usermount *pu, puffs_cookie_t cookie); int puffs_flush_pagecache_node_range(struct puffs_usermount *pu, puffs_cookie_t cookie, off_t start, off_t end); DESCRIPTION
These routines are used inform the kernel that any information it might have cached is no longer valid. puffs_inval_namecache_dir() invali- dates the name cache for a given directory. The argument cookie should describe an existing and valid directory cookie for the file system. Similarly, puffs_inval_namecache_all() invalidates the name cache for the entire file system (this routine might go away). The cached pages (file contents) for a regular file described by cookie are invalidated using puffs_inval_pagecache_node(). A specific range can be invalidated using puffs_inval_pagecache_node_range() for a platform specific page level granularity. The offset start will be truncated to a page boundary while end will be rounded up to the next page boundary. As a special case, specifying 0 as end will invalidate all contents from start to the end of the file. It is especially important to note that these routines will not only invalidate data in the "read cache", but also data in the "write back" cache (conceptually speaking; in reality they are the same cache), which has not yet been flushed to the file server. Therefore any unflushed data will be lost. The counterparts of the invalidation routines are the flushing routines puffs_flush_pagecache_node() and puffs_flush_pagecache_node_range(), which force unwritten data from the kernel page cache to be written. For the flush range version, the same range rules as with the invalida- tion routine apply. The data is flushed asynchronously, i.e. if the routine returns successfully, all the caller knows is that the data has been queued for writing. SEE ALSO
puffs(3) BSD
April 7, 2007 BSD

Check Out this Related Man Page

PUFFS_NODE(3)						   BSD Library Functions Manual 					     PUFFS_NODE(3)

NAME
puffs_node -- puffs node routines LIBRARY
puffs Convenience Library (libpuffs, -lpuffs) SYNOPSIS
#include <puffs.h> struct puffs_node * puffs_pn_new(struct puffs_usermount *pu, void *priv); void * puffs_nodewalk_fn(struct puffs_usermount *pu, struct puffs_node *pn, void *arg); void * puffs_pn_nodewalk(struct puffs_usermount *pu, puffs_nodewalk_fn nwfn, void *arg); void puffs_pn_remove(struct puffs_node *pn); void puffs_pn_put(struct puffs_node *pn); DESCRIPTION
puffs_pn_new(pu, priv) Create a new node and attach it to the mountpoint pu. The argument priv can be used for associating file system specific data with the new node and will not be accessed by puffs. puffs_nodewalk_fn(pu, pn, arg) A callback for puffs_nodewalk(). The list of nodes is iterated in the argument pn and the argument arg is the argument given to puffs_nodewalk(). puffs_nodewalk(pu, nwfn, arg) Walk all nodes associted with the mountpoint pu and call nwfn() for them. The walk is aborted if puffs_nodewalk_fn() returns a value which is not NULL. This value is also returned this function. In case the whole set of nodes is traversed, NULL is returned. This function is useful for example in handling the puffs_fs_sync() callback, when cached data for every node should be flushed to stable storage. puffs_pn_remove(pn) Signal that a node has been removed from the file system, but do not yet release resources associated with the node. This will prevent the nodewalk functions from accessing the node. If necessary, this is usually called from puffs_node_remove() and puffs_node_rmdir(). puffs_pn_put(pn) Free all resources associated with node pn. This is typically called from puffs_node_reclaim(). SEE ALSO
puffs(3) BSD
June 24, 2007 BSD
Man Page