/* *Themaximumsize(intothekernelorreturnedfromthekernel)ofan *attributevalueorthebufferusedforanattr_list()call.Larger *sizeswillresultinanERANGEreturncode.
*/ #define ATTR_MAX_VALUELEN (64*1024) /* max length of a value */
/* *Kernel-internalversionoftheattrlistcursor.
*/ struct xfs_attrlist_cursor_kern {
__u32 hashval; /* hash value of next entry to add */
__u32 blkno; /* block containing entry (suggestion) */
__u32 offset; /* offset in list of equal-hashvals */
__u16 pad1; /* padding to match user-level */
__u8 pad2; /* padding to match user-level */
__u8 initted; /* T/F: cursor has been initialized */
};
/* void; state communicated via *context */ typedefvoid (*put_listent_func_t)(struct xfs_attr_list_context *context, int flags, unsignedchar *name, int namelen, void *value, int valuelen);
struct xfs_attr_list_context { struct xfs_trans *tp; struct xfs_inode *dp; /* inode */ struct xfs_attrlist_cursor_kern cursor; /* position in list */ void *buffer; /* output buffer */
/* *Abortattributelistiterationifnon-zero.Canbeusedtopass *errorvaluestothexfs_attr_listcaller.
*/ int seen_enough; bool allow_incomplete;
ssize_t count; /* num used entries */ int dupcnt; /* count dup hashvals seen */ int bufsize; /* total buffer size */ int firstu; /* first used byte in buffer */ unsignedint attr_filter; /* XFS_ATTR_{ROOT,SECURE} */ int resynch; /* T/F: resynch with cursor */
put_listent_func_t put_listent; /* list output fmt function */ int index; /* index into output buffer */
};
/* *Enumvaluesforxfs_attr_intent.xattri_da_state * *Thesevaluesareusedbydelayedattributeoperationstokeeptrackofwhere *theywerebeforetheyreturned-EAGAIN.Areturncodeof-EAGAINsignalsthe *callingfunctiontorollthetransaction,andthencallthesubroutineto *finishtheoperation.Theenumisthenusedbythesubroutinetojumpback *towhereitwasandresumeexecutingwhereitleftoff.
*/ enum xfs_delattr_state {
XFS_DAS_UNINIT = 0, /* No state has been set yet */
/* *Initialsequencestates.Thereplacesetupcodereliesonthe *ADDandREMOVEstatesforaspecificformattobesequentialso *thatwecantransformtheinitialoperationtobeperformed *accordingtothexfs_has_larp()stateeasily.
*/
XFS_DAS_SF_ADD, /* Initial sf add state */
XFS_DAS_SF_REMOVE, /* Initial sf replace/remove state */
XFS_DAS_LEAF_ADD, /* Initial leaf add state */
XFS_DAS_LEAF_REMOVE, /* Initial leaf replace/remove state */
XFS_DAS_NODE_ADD, /* Initial node add state */
XFS_DAS_NODE_REMOVE, /* Initial node replace/remove state */
/* Leaf state set/replace/remove sequence */
XFS_DAS_LEAF_SET_RMT, /* set a remote xattr from a leaf */
XFS_DAS_LEAF_ALLOC_RMT, /* We are allocating remote blocks */
XFS_DAS_LEAF_REPLACE, /* Perform replace ops on a leaf */
XFS_DAS_LEAF_REMOVE_OLD, /* Start removing old attr from leaf */
XFS_DAS_LEAF_REMOVE_RMT, /* A rename is removing remote blocks */
XFS_DAS_LEAF_REMOVE_ATTR, /* Remove the old attr from a leaf */
/* Node state sequence, must match leaf state above */
XFS_DAS_NODE_SET_RMT, /* set a remote xattr from a node */
XFS_DAS_NODE_ALLOC_RMT, /* We are allocating remote blocks */
XFS_DAS_NODE_REPLACE, /* Perform replace ops on a node */
XFS_DAS_NODE_REMOVE_OLD, /* Start removing old attr from node */
XFS_DAS_NODE_REMOVE_RMT, /* A rename is removing remote blocks */
XFS_DAS_NODE_REMOVE_ATTR, /* Remove the old attr from a node */
/* Used in xfs_attr_rmtval_set_blk to roll through allocating blocks */
xfs_dablk_t xattri_lblkno; int xattri_blkcnt; struct xfs_bmbt_irec xattri_map;
};
/* *Overallexternalinterfaceroutines.
*/ int xfs_attr_inactive(struct xfs_inode *dp); int xfs_attr_list_ilocked(struct xfs_attr_list_context *); int xfs_attr_list(struct xfs_attr_list_context *); int xfs_inode_hasattr(struct xfs_inode *ip); bool xfs_attr_is_leaf(struct xfs_inode *ip); int xfs_attr_get_ilocked(struct xfs_da_args *args); int xfs_attr_get(struct xfs_da_args *args);
enum xfs_attr_update {
XFS_ATTRUPDATE_REMOVE, /* remove attr */
XFS_ATTRUPDATE_UPSERT, /* set value, replace any existing attr */
XFS_ATTRUPDATE_CREATE, /* set value, fail if attr already exists */
XFS_ATTRUPDATE_REPLACE, /* set value, fail if attr does not exist */
};
int xfs_attr_set(struct xfs_da_args *args, enum xfs_attr_update op, bool rsvd); int xfs_attr_set_iter(struct xfs_attr_intent *attr); int xfs_attr_remove_iter(struct xfs_attr_intent *attr); bool xfs_attr_check_namespace(unsignedint attr_flags); bool xfs_attr_namecheck(unsignedint attr_flags, constvoid *name,
size_t length); int xfs_attr_calc_size(struct xfs_da_args *args, int *local); struct xfs_trans_res xfs_attr_set_resv(conststruct xfs_da_args *args);
xfs_dahash_t xfs_attr_hashname(const uint8_t *name, int namelen);
xfs_dahash_t xfs_attr_hashval(struct xfs_mount *mp, unsignedint attr_flags, const uint8_t *name, int namelen, constvoid *value, int valuelen);
/* Set the hash value for any extended attribute from any namespace. */ staticinlinevoid xfs_attr_sethash(struct xfs_da_args *args)
{
args->hashval = xfs_attr_hashval(args->dp->i_mount, args->attr_filter,
args->name, args->namelen,
args->value, args->valuelen);
}
externstruct kmem_cache *xfs_attr_intent_cache; int __init xfs_attr_intent_init_cache(void); void xfs_attr_intent_destroy_cache(void);
int xfs_attr_sf_totsize(struct xfs_inode *dp); int xfs_attr_add_fork(struct xfs_inode *ip, int size, int rsvd);
#endif/* __XFS_ATTR_H__ */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.28 Sekunden
(vorverarbeitet am 2026-09-28)
¤
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.