int xfs_dir_lookup_args(struct xfs_da_args *args); int xfs_dir_createname_args(struct xfs_da_args *args); int xfs_dir_removename_args(struct xfs_da_args *args); int xfs_dir_replace_args(struct xfs_da_args *args);
/* * Direct call from the bmap code, bypassing the generic directory layer.
*/ externint xfs_dir2_sf_to_block(struct xfs_da_args *args);
/* * Interface routines used by userspace utilities
*/ externint xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db, struct xfs_buf *bp);
/* * Directory offset/block conversion functions. * * DB blocks here are logical directory block numbers, not filesystem blocks.
*/
/* * Convert dataptr to byte in file space
*/ staticinline xfs_dir2_off_t
xfs_dir2_dataptr_to_byte(xfs_dir2_dataptr_t dp)
{ return (xfs_dir2_off_t)dp << XFS_DIR2_DATA_ALIGN_LOG;
}
/* * Convert byte in file space to dataptr. It had better be aligned.
*/ staticinline xfs_dir2_dataptr_t
xfs_dir2_byte_to_dataptr(xfs_dir2_off_t by)
{ return (xfs_dir2_dataptr_t)(by >> XFS_DIR2_DATA_ALIGN_LOG);
}
/* * Convert byte in space to (DB) block
*/ staticinline xfs_dir2_db_t
xfs_dir2_byte_to_db(struct xfs_da_geometry *geo, xfs_dir2_off_t by)
{ return (xfs_dir2_db_t)(by >> geo->blklog);
}
/* * Convert dataptr to a block number
*/ staticinline xfs_dir2_db_t
xfs_dir2_dataptr_to_db(struct xfs_da_geometry *geo, xfs_dir2_dataptr_t dp)
{ return xfs_dir2_byte_to_db(geo, xfs_dir2_dataptr_to_byte(dp));
}
/* * Convert byte in space to offset in a block
*/ staticinline xfs_dir2_data_aoff_t
xfs_dir2_byte_to_off(struct xfs_da_geometry *geo, xfs_dir2_off_t by)
{ return (xfs_dir2_data_aoff_t)(by & (geo->blksize - 1));
}
/* * Convert dataptr to a byte offset in a block
*/ staticinline xfs_dir2_data_aoff_t
xfs_dir2_dataptr_to_off(struct xfs_da_geometry *geo, xfs_dir2_dataptr_t dp)
{ return xfs_dir2_byte_to_off(geo, xfs_dir2_dataptr_to_byte(dp));
}
/* * Convert block and offset to byte in space
*/ staticinline xfs_dir2_off_t
xfs_dir2_db_off_to_byte(struct xfs_da_geometry *geo, xfs_dir2_db_t db,
xfs_dir2_data_aoff_t o)
{ return ((xfs_dir2_off_t)db << geo->blklog) + o;
}
/* * The Linux API doesn't pass down the total size of the buffer * we read into down to the filesystem. With the filldir concept * it's not needed for correct information, but the XFS dir2 leaf * code wants an estimate of the buffer size to calculate it's * readahead window and size the buffers used for mapping to * physical blocks. * * Try to give it an estimate that's good enough, maybe at some * point we can change the ->readdir prototype to include the * buffer size. For now we use the current glibc buffer size. * musl libc hardcodes 2k and dietlibc uses PAGE_SIZE.
*/ #define XFS_READDIR_BUFSIZE (32768)
/* * The "ascii-ci" feature was created to speed up case-insensitive lookups for * a Samba product. Because of the inherent problems with CI and UTF-8 * encoding, etc, it was decided that Samba would be configured to export * latin1/iso 8859-1 encodings as that covered >90% of the target markets for * the product. Hence the "ascii-ci" casefolding code could be encoded into * the XFS directory operations and remove all the overhead of casefolding from * Samba. * * To provide consistent hashing behavior between the userspace and kernel, * these functions prepare names for hashing by transforming specific bytes * to other bytes. Robustness with other encodings is not guaranteed.
*/ staticinlinebool xfs_ascii_ci_need_xfrm(unsignedchar c)
{ if (c >= 0x41 && c <= 0x5a) /* A-Z */ returntrue; if (c >= 0xc0 && c <= 0xd6) /* latin A-O with accents */ returntrue; if (c >= 0xd8 && c <= 0xde) /* latin O-Y with accents */ returntrue; returnfalse;
}
staticinlineunsignedchar xfs_ascii_ci_xfrm(unsignedchar c)
{ if (xfs_ascii_ci_need_xfrm(c))
c -= 'A' - 'a'; return c;
}
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.