Copyright (C) 2000-2012 |
GNU Info (libext2fs.info)Inode count functionsInode count functions --------------------- The icount abstraction is a specialized data type used by `e2fsck' to store how many times a particular inode is referenced by the filesystem. This is used twice; once to store the actual number of times that the inode is reference; and once to store the claimed number of times the inode is referenced according to the inode structure. This abstraction is designed to be extremely efficient for storing this sort of information, by taking advantage of the following properties of inode counts, namely (1) inode counts are very often zero (because the inode is currrently not in use), and (2) many files have a inode count of 1 (because they are a file which has no additional hard links). - Function: errcode_t ext2fs_create_icount2 (ext2_filsys FS, int FLAGS, int SIZE, ext2_icount_t HINT, ext2_icount_t *RET) Creates an icount stucture for a filesystem FS, with initial space for SIZE inodes whose count is greater than 1. The FLAGS parameter is either 0 or `EXT2_ICOUNT_OPT_INCREMENT', which indicates that icount structure should be able to increment inode counts quickly. The icount structure is returned in RET. The returned icount structure initially has a count of zero for all inodes. The HINT parameter allows the caller to optionally pass in another icount structure which is used to initialize the array of inodes whose count is greater than 1. It is used purely as a speed optimization so that the icount structure can determine in advance which inodes are likely to contain a count grater than 1. - Function: void ext2fs_free_icount (ext2_icount_t ICOUNT) Frees an icount structure. - Function: errcode_t ext2fs_icount_fetch (ext2_icount_t ICOUNT, ext2_ino_t INO, __u16 *RET) Returns in RET fetches the count for a particular inode INO. - Function: errcode_t ext2fs_icount_increment (ext2_icount_t ICOUNT, ext2_ino_t INO, __u16 *RET) Increments the ref count for inode INO. - Function: errcode_t ext2fs_icount_decrement (ext2_icount_t ICOUNT, ext2_ino_t INO, __u16 *RET) Decrements the ref count for inode INO. - Function: errcode_t ext2fs_icount_store (ext2_icount_t ICOUNT, ext2_ino_t INO, __u16 COUNT) Sets the reference count for inode INO to be COUNT. - Function: ext2_ino_t ext2fs_get_icount_size (ext2_icount_t ICOUNT) Returns the current number of inodes in ICOUNT which has a count greater than 1. - Function: errcode_t ext2fs_icount_validate (ext2_icount_t ICOUNT, FILE *F) Validates the internal rep invariant of ICOUNT; if there are any problems, print out debugging information to F. This function is intended for debugging and testing use only. automatically generated by info2www version 1.2.2.9 |