return 0;
}
-STATIC int
+int
xfs_inode_hasattr(
struct xfs_inode *ip)
{
if (rsvd)
args.trans->t_flags |= XFS_TRANS_RESERVE;
-
error = xfs_trans_reserve(args.trans, args.total,
XFS_ATTRSETM_LOG_RES(mp) +
XFS_ATTRSETRT_LOG_RES(mp) * args.total,
return xfs_attr_remove_int(dp, &xname, flags);
}
+
/*========================================================================
* External routines when attribute list is inside the inode
*========================================================================*/
error = xfs_attr3_leaf_lookup_int(bp, args);
if (error == ENOATTR) {
xfs_trans_brelse(args->trans, bp);
- return(error);
+ return error;
}
xfs_attr3_leaf_remove(bp, args);
int *number_entries_in_blk1,
int *number_usedbytes_in_blk1);
-
/*
* Utility routines.
*/
struct xfs_attr_leaf_entry *entry;
struct xfs_attr_leaf_name_local *name_loc;
struct xfs_attr_leaf_name_remote *name_rmt;
- struct xfs_attr_leaf_map *map;
struct xfs_mount *mp;
int tmp;
int i;
tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t)
+ xfs_attr3_leaf_hdr_size(leaf);
- for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; map++, i++) {
+ for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
if (ichdr->freemap[i].base == tmp) {
ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t);
ichdr->freemap[i].size -= sizeof(xfs_attr_leaf_entry_t);
* Move the remaining entries down to fill the hole,
* then zero the entries at the top.
*/
- tmp = (ichdr_s->count - count) - sizeof(xfs_attr_leaf_entry_t);
+ tmp = (ichdr_s->count - count) * sizeof(xfs_attr_leaf_entry_t);
entry_s = &xfs_attr3_leaf_entryp(leaf_s)[start_s + count];
entry_d = &xfs_attr3_leaf_entryp(leaf_s)[start_s];
memmove(entry_d, entry_s, tmp);
return size;
}
+
/*========================================================================
* Manage the INCOMPLETE flag in a leaf entry
*========================================================================*/