/* *Searchcomparisonresults
*/ enum xfs_dacmp {
XFS_CMP_DIFFERENT, /* names are completely different */
XFS_CMP_EXACT, /* names are exactly the same */
XFS_CMP_CASE /* names are same but differ in case */
};
/* *Structuretoeasepassingaroundcomponentnames.
*/ typedefstruct xfs_da_args { struct xfs_da_geometry *geo; /* da block geometry */ const uint8_t *name; /* string (maybe not NULL terminated) */ const uint8_t *new_name; /* new attr name */ void *value; /* set of bytes (maybe contain NULLs) */ void *new_value; /* new xattr value (may contain NULLs) */ struct xfs_inode *dp; /* directory inode to manipulate */ struct xfs_trans *trans; /* current trans (changes over time) */
xfs_ino_t inumber; /* input/output inode number */
xfs_ino_t owner; /* inode that owns the dir/attr data */
int valuelen; /* length of value */ int new_valuelen; /* length of new_value */
uint8_t filetype; /* filetype of inode for directories */
uint8_t op_flags; /* operation flags */
uint8_t attr_filter; /* XFS_ATTR_{ROOT,SECURE,INCOMPLETE} */ short namelen; /* length of string (maybe no NULL) */ short new_namelen; /* length of new attr name */
xfs_dahash_t hashval; /* hash value of name */
xfs_extlen_t total; /* total blocks needed, for 1st bmap */ int whichfork; /* data or attribute fork */
xfs_dablk_t blkno; /* blkno of attr leaf of interest */ int index; /* index of attr of interest in blk */
xfs_dablk_t rmtblkno; /* remote attr value starting blkno */ int rmtblkcnt; /* remote attr value block count */ int rmtvaluelen; /* remote attr value length in bytes */
xfs_dablk_t blkno2; /* blkno of 2nd attr leaf of interest */ int index2; /* index of 2nd attr in blk */
xfs_dablk_t rmtblkno2; /* remote attr value starting blkno */ int rmtblkcnt2; /* remote attr value block count */ int rmtvaluelen2; /* remote attr value length in bytes */ enum xfs_dacmp cmpresult; /* name compare result for lookups */
} xfs_da_args_t;
/* *Operationflags:
*/ #define XFS_DA_OP_JUSTCHECK (1u << 0) /* check for ok with no space */ #define XFS_DA_OP_REPLACE (1u << 1) /* this is an atomic replace op */ #define XFS_DA_OP_ADDNAME (1u << 2) /* this is an add operation */ #define XFS_DA_OP_OKNOENT (1u << 3) /* lookup op, ENOENT ok, else die */ #define XFS_DA_OP_CILOOKUP (1u << 4) /* lookup returns CI name if found */ #define XFS_DA_OP_RECOVERY (1u << 5) /* Log recovery operation */ #define XFS_DA_OP_LOGGED (1u << 6) /* Use intent items to track op */
/* *StorageforholdingstateduringBtreesearchesandsplit/joinops. * *Onlyneedspacefor5intermediatenodes.Withaminimumof62-way *fanouttotheBtree,wecansupportover900milliondirectoryblocks, *whichisslightlymorethanenough.
*/ typedefstruct xfs_da_state_blk { struct xfs_buf *bp; /* buffer containing block */
xfs_dablk_t blkno; /* filesystem blkno of buffer */
xfs_daddr_t disk_blkno; /* on-disk blkno (in BBs) of buffer */ int index; /* relevant index into block */
xfs_dahash_t hashval; /* last hash value in block */ int magic; /* blk's magic number, ie: blk type */
} xfs_da_state_blk_t;
typedefstruct xfs_da_state_path { int active; /* number of active levels */
xfs_da_state_blk_t blk[XFS_DA_NODE_MAXDEPTH];
} xfs_da_state_path_t;
typedefstruct xfs_da_state {
xfs_da_args_t *args; /* filename arguments */ struct xfs_mount *mp; /* filesystem mount point */
xfs_da_state_path_t path; /* search/split paths */
xfs_da_state_path_t altpath; /* alternate path for join */ unsignedchar inleaf; /* insert into 1->lf, 0->splf */ unsignedchar extravalid; /* T/F: extrablk is in use */ unsignedchar extraafter; /* T/F: extrablk is after new */
xfs_da_state_blk_t extrablk; /* for double-splits on leaves */ /* for dirv2 extrablk is data */
} xfs_da_state_t;
/* *RoutinesusedforgrowingtheBtree.
*/ int xfs_da3_node_create(struct xfs_da_args *args, xfs_dablk_t blkno, int level, struct xfs_buf **bpp, int whichfork); int xfs_da3_split(xfs_da_state_t *state);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.