| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * Copyright (c) 2000,2002-2003,2005 Silicon Graphics, Inc. |
|---|
| 4 | 4 | * Copyright (c) 2013 Red Hat, Inc. |
|---|
| .. | .. |
|---|
| 8 | 8 | #define __XFS_ATTR_LEAF_H__ |
|---|
| 9 | 9 | |
|---|
| 10 | 10 | struct attrlist; |
|---|
| 11 | | -struct attrlist_cursor_kern; |
|---|
| 12 | 11 | struct xfs_attr_list_context; |
|---|
| 13 | 12 | struct xfs_da_args; |
|---|
| 14 | 13 | struct xfs_da_state; |
|---|
| .. | .. |
|---|
| 17 | 16 | struct xfs_trans; |
|---|
| 18 | 17 | |
|---|
| 19 | 18 | /* |
|---|
| 20 | | - * Used to keep a list of "remote value" extents when unlinking an inode. |
|---|
| 19 | + * Incore version of the attribute leaf header. |
|---|
| 21 | 20 | */ |
|---|
| 22 | | -typedef struct xfs_attr_inactive_list { |
|---|
| 23 | | - xfs_dablk_t valueblk; /* block number of value bytes */ |
|---|
| 24 | | - int valuelen; /* number of bytes in value */ |
|---|
| 25 | | -} xfs_attr_inactive_list_t; |
|---|
| 26 | | - |
|---|
| 21 | +struct xfs_attr3_icleaf_hdr { |
|---|
| 22 | + uint32_t forw; |
|---|
| 23 | + uint32_t back; |
|---|
| 24 | + uint16_t magic; |
|---|
| 25 | + uint16_t count; |
|---|
| 26 | + uint16_t usedbytes; |
|---|
| 27 | + /* |
|---|
| 28 | + * Firstused is 32-bit here instead of 16-bit like the on-disk variant |
|---|
| 29 | + * to support maximum fsb size of 64k without overflow issues throughout |
|---|
| 30 | + * the attr code. Instead, the overflow condition is handled on |
|---|
| 31 | + * conversion to/from disk. |
|---|
| 32 | + */ |
|---|
| 33 | + uint32_t firstused; |
|---|
| 34 | + __u8 holes; |
|---|
| 35 | + struct { |
|---|
| 36 | + uint16_t base; |
|---|
| 37 | + uint16_t size; |
|---|
| 38 | + } freemap[XFS_ATTR_LEAF_MAPSIZE]; |
|---|
| 39 | +}; |
|---|
| 27 | 40 | |
|---|
| 28 | 41 | /*======================================================================== |
|---|
| 29 | 42 | * Function prototypes for the kernel. |
|---|
| .. | .. |
|---|
| 39 | 52 | int xfs_attr_shortform_to_leaf(struct xfs_da_args *args, |
|---|
| 40 | 53 | struct xfs_buf **leaf_bp); |
|---|
| 41 | 54 | int xfs_attr_shortform_remove(struct xfs_da_args *args); |
|---|
| 55 | +int xfs_attr_sf_findname(struct xfs_da_args *args, |
|---|
| 56 | + struct xfs_attr_sf_entry **sfep, |
|---|
| 57 | + unsigned int *basep); |
|---|
| 42 | 58 | int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp); |
|---|
| 43 | 59 | int xfs_attr_shortform_bytesfit(struct xfs_inode *dp, int bytes); |
|---|
| 44 | 60 | xfs_failaddr_t xfs_attr_shortform_verify(struct xfs_inode *ip); |
|---|
| .. | .. |
|---|
| 67 | 83 | struct xfs_da_args *args); |
|---|
| 68 | 84 | int xfs_attr3_leaf_remove(struct xfs_buf *leaf_buffer, |
|---|
| 69 | 85 | struct xfs_da_args *args); |
|---|
| 70 | | -void xfs_attr3_leaf_list_int(struct xfs_buf *bp, |
|---|
| 71 | | - struct xfs_attr_list_context *context); |
|---|
| 86 | +int xfs_attr3_leaf_list_int(struct xfs_buf *bp, |
|---|
| 87 | + struct xfs_attr_list_context *context); |
|---|
| 72 | 88 | |
|---|
| 73 | 89 | /* |
|---|
| 74 | 90 | * Routines used for shrinking the Btree. |
|---|
| .. | .. |
|---|
| 85 | 101 | struct xfs_buf *leaf2_bp); |
|---|
| 86 | 102 | int xfs_attr_leaf_newentsize(struct xfs_da_args *args, int *local); |
|---|
| 87 | 103 | int xfs_attr3_leaf_read(struct xfs_trans *tp, struct xfs_inode *dp, |
|---|
| 88 | | - xfs_dablk_t bno, xfs_daddr_t mappedbno, |
|---|
| 89 | | - struct xfs_buf **bpp); |
|---|
| 104 | + xfs_dablk_t bno, struct xfs_buf **bpp); |
|---|
| 90 | 105 | void xfs_attr3_leaf_hdr_from_disk(struct xfs_da_geometry *geo, |
|---|
| 91 | 106 | struct xfs_attr3_icleaf_hdr *to, |
|---|
| 92 | 107 | struct xfs_attr_leafblock *from); |
|---|