hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
kernel/fs/xfs/libxfs/xfs_attr_leaf.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * Copyright (c) 2000,2002-2003,2005 Silicon Graphics, Inc.
44 * Copyright (c) 2013 Red Hat, Inc.
....@@ -8,7 +8,6 @@
88 #define __XFS_ATTR_LEAF_H__
99
1010 struct attrlist;
11
-struct attrlist_cursor_kern;
1211 struct xfs_attr_list_context;
1312 struct xfs_da_args;
1413 struct xfs_da_state;
....@@ -17,13 +16,27 @@
1716 struct xfs_trans;
1817
1918 /*
20
- * Used to keep a list of "remote value" extents when unlinking an inode.
19
+ * Incore version of the attribute leaf header.
2120 */
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
+};
2740
2841 /*========================================================================
2942 * Function prototypes for the kernel.
....@@ -39,6 +52,9 @@
3952 int xfs_attr_shortform_to_leaf(struct xfs_da_args *args,
4053 struct xfs_buf **leaf_bp);
4154 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);
4258 int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp);
4359 int xfs_attr_shortform_bytesfit(struct xfs_inode *dp, int bytes);
4460 xfs_failaddr_t xfs_attr_shortform_verify(struct xfs_inode *ip);
....@@ -67,8 +83,8 @@
6783 struct xfs_da_args *args);
6884 int xfs_attr3_leaf_remove(struct xfs_buf *leaf_buffer,
6985 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);
7288
7389 /*
7490 * Routines used for shrinking the Btree.
....@@ -85,8 +101,7 @@
85101 struct xfs_buf *leaf2_bp);
86102 int xfs_attr_leaf_newentsize(struct xfs_da_args *args, int *local);
87103 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);
90105 void xfs_attr3_leaf_hdr_from_disk(struct xfs_da_geometry *geo,
91106 struct xfs_attr3_icleaf_hdr *to,
92107 struct xfs_attr_leafblock *from);