group
group__libshare__fsinode
A partition inode is the containing class which encapsulates all forms of data stored on a share-fs partition.

Partition Inode Blocks

typedef
typedef struct shstat shstat
function
shfs_ino_t* shfs_inode
(shfs_ino_t *parent, char *name, int mode)
Retrieve a sharefs inode entry based on a given parent inode and path name.
Note
Searches for a reference to a sharefs inode labelled "name" in the inode. parent A new inode is created if a pre-existing one is not found.
Return Value
A is returned based on the , , mode specified. If one already exists it will be returned, and otherwise a new entry will be created.
shfs_node parent name and
Note
A new inode will be linked to the sharefs partition if it does not exist.
Param
parent
The parent inode such as a directory where the file presides.
name
The relational pathname of the file being referenced.
mode
The type of information that this inode is referencing (SHINODE_XX).
function
shfs_ino_t* shfs_inode_load
(shfs_ino_t *parent, shkey_t *key)
Retrieve a sharefs inode child entry based on a token key.
function
shfs_t* shfs_inode_tree
(shfs_ino_t *inode)
Obtain the shfs partition associated with a particular inode.
Param
inode
The inode in reference.
function
shpeer_t* shfs_inode_peer
(shfs_ino_t *inode)
function
shfs_ino_t* shfs_inode_root
(shfs_ino_t *inode)
Obtain the root partition inode associated with a particular inode.
Param
inode
The inode in reference.
function
shfs_ino_t* shfs_inode_parent
(shfs_ino_t *inode)
Obtain the parent [directory/container] inode associated with a particular inode.
Param
inode
The inode in reference.
function
int shfs_inode_write_entity
(shfs_ino_t *ent)
Write an entity such as a file inode.
function
int shfs_inode_truncate
(shfs_ino_t *inode, shsize_t ino_len)
Truncates the inode's underlying data to a specified size if the size is greater than the size of the inode or increases the size with blank data if the specified size is greater.
Param
inode
The non-container inode to adjust data size.
ino_len
The desired length of the inode's underlying data segment.
Note
Increasing the file size does not immediately increase the underlying data content size.
function
shsize_t shfs_size
(shfs_ino_t *file)
function
int shfs_inode_write_block
(shfs_t *tree, shfs_block_t *blk)
Writes a single inode block to a sharefs filesystem journal.
function
int shfs_inode_read_block
(shfs_t *tree, shfs_idx_t *pos, shfs_block_t *blk)
Retrieve a single data block from a sharefs filesystem inode.
See
shfs_init() group__libshare__fspartition_1ga15a8d8f6327752a7e924d348f260aa33 member
Return Value
Returns 0 on success and a SHERR_XXX on failure.
Param
tree
The sharefs partition allocated by . shfs_init() group__libshare__fspartition_1ga15a8d8f6327752a7e924d348f260aa33 member
inode
The inode whose data is being retrieved.
hdr
A specification of where the block is location in the sharefs filesystem partition.
inode
The inode block data to be filled in.
function
shkey_t* shfs_token_init
(shfs_ino_t *parent, int mode, char *fname)
Returns a unique key token representing an inode.
Param
parent
The parent inode of the inode being referenced.
Note
free the returned key with shkey_free()
function
void shfs_filename_set
(shfs_ino_t *inode, char *name)
Assign an inode a filename.
function
char* shfs_filename
(shfs_ino_t *inode)
Returns the filename of the inode.
function
char* shfs_inode_path
(shfs_ino_t *inode)
function
char* shfs_inode_id
(shfs_ino_t *inode)
A unique hexadecimal string representing a sharefs inode.
function
char* shfs_inode_print
(shfs_ino_t *inode)
function
char* shfs_inode_block_print
(shfs_block_t *jblk)
function
char* shfs_inode_size_str
(shsize_t size)
function
uint64_t shfs_crc_init
(shfs_block_t *blk)
Create a inode checksum.
function
uint64_t shfs_crc
(shfs_ino_t *file)
The share library file inode's data checksum.
function
int shfs_block_type
(shfs_block_t *blk)
The type of an inode block.
function
int shfs_type
(shfs_ino_t *inode)
The type of inode.
function
int shfs_block_format
(shfs_block_t *blk)
The format of an inode block.
function
int shfs_format
(shfs_ino_t *inode)
The format of an inode.
function
int shfs_format_set
(shfs_ino_t *file, int format)
Convert the inode to hold a different data format.
function
char* shfs_type_str
(int type)
A string representation of an inode type.
function
char shfs_type_char
(int type)
A single-character reference to an inode type.
function
char* shfs_format_str
(int format)
A string representation of an inode format.
function
int shfs_block_stat
(shfs_block_t *blk, shstat *st)
function
int shfs_fstat
(shfs_ino_t *file, shstat *st)
Obtain inode attribute information.
An SHERR_NOENT error occurs if inode format is not set.
Param
The
inode to generate info for.
st
The result info structure.
Return Value
Zero (0) on success or a libshare error code.
function
int shfs_stat
(shfs_t *fs, const char *path, shstat *st)
Obtain inode attribute information for a path.
function
shkey_t* shfs_token
(shfs_ino_t *inode)
function
int shfs_inode_remove
(shfs_ino_t *file)
function
int shfs_unlink
(shfs_t *fs, char *path)
Clear the contents of a sharefs inode.
function
shtime_t shfs_ctime
(shfs_ino_t *ino)
function
shtime_t shfs_mtime
(shfs_ino_t *ino)