]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - fs/xfs/libxfs/xfs_attr_leaf.h
Merge tag 'trace-v4.15-rc4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rosted...
[mirror_ubuntu-bionic-kernel.git] / fs / xfs / libxfs / xfs_attr_leaf.h
CommitLineData
1da177e4 1/*
7b718769 2 * Copyright (c) 2000,2002-2003,2005 Silicon Graphics, Inc.
517c2220 3 * Copyright (c) 2013 Red Hat, Inc.
aa82daa0 4 * All Rights Reserved.
1da177e4 5 *
7b718769
NS
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
1da177e4
LT
8 * published by the Free Software Foundation.
9 *
7b718769
NS
10 * This program is distributed in the hope that it would be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
1da177e4 14 *
7b718769
NS
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1da177e4
LT
18 */
19#ifndef __XFS_ATTR_LEAF_H__
20#define __XFS_ATTR_LEAF_H__
21
1da177e4
LT
22struct attrlist;
23struct attrlist_cursor_kern;
ad9b463a 24struct xfs_attr_list_context;
1da177e4
LT
25struct xfs_da_args;
26struct xfs_da_state;
27struct xfs_da_state_blk;
28struct xfs_inode;
29struct xfs_trans;
30
1da177e4
LT
31/*
32 * Used to keep a list of "remote value" extents when unlinking an inode.
33 */
34typedef struct xfs_attr_inactive_list {
35 xfs_dablk_t valueblk; /* block number of value bytes */
36 int valuelen; /* number of bytes in value */
37} xfs_attr_inactive_list_t;
38
39
40/*========================================================================
41 * Function prototypes for the kernel.
42 *========================================================================*/
43
44/*
d8cc890d 45 * Internal routines when attribute fork size < XFS_LITINO(mp).
1da177e4 46 */
d8cc890d
NS
47void xfs_attr_shortform_create(struct xfs_da_args *args);
48void xfs_attr_shortform_add(struct xfs_da_args *args, int forkoff);
1da177e4
LT
49int xfs_attr_shortform_lookup(struct xfs_da_args *args);
50int xfs_attr_shortform_getvalue(struct xfs_da_args *args);
6e643cd0
DW
51int xfs_attr_shortform_to_leaf(struct xfs_da_args *args,
52 struct xfs_buf **leaf_bp);
d8cc890d 53int xfs_attr_shortform_remove(struct xfs_da_args *args);
1d9025e5 54int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp);
ae90b994 55int xfs_attr_shortform_bytesfit(struct xfs_inode *dp, int bytes);
6dfe5a04 56void xfs_attr_fork_remove(struct xfs_inode *ip, struct xfs_trans *tp);
1da177e4
LT
57
58/*
d8cc890d 59 * Internal routines when attribute fork size == XFS_LBSIZE(mp).
1da177e4 60 */
517c2220
DC
61int xfs_attr3_leaf_to_node(struct xfs_da_args *args);
62int xfs_attr3_leaf_to_shortform(struct xfs_buf *bp,
d8cc890d 63 struct xfs_da_args *args, int forkoff);
517c2220
DC
64int xfs_attr3_leaf_clearflag(struct xfs_da_args *args);
65int xfs_attr3_leaf_setflag(struct xfs_da_args *args);
66int xfs_attr3_leaf_flipflags(struct xfs_da_args *args);
1da177e4
LT
67
68/*
69 * Routines used for growing the Btree.
70 */
517c2220 71int xfs_attr3_leaf_split(struct xfs_da_state *state,
1da177e4
LT
72 struct xfs_da_state_blk *oldblk,
73 struct xfs_da_state_blk *newblk);
517c2220 74int xfs_attr3_leaf_lookup_int(struct xfs_buf *leaf,
1da177e4 75 struct xfs_da_args *args);
517c2220
DC
76int xfs_attr3_leaf_getvalue(struct xfs_buf *bp, struct xfs_da_args *args);
77int xfs_attr3_leaf_add(struct xfs_buf *leaf_buffer,
1da177e4 78 struct xfs_da_args *args);
517c2220 79int xfs_attr3_leaf_remove(struct xfs_buf *leaf_buffer,
1da177e4 80 struct xfs_da_args *args);
f7a136ae 81void xfs_attr3_leaf_list_int(struct xfs_buf *bp,
1da177e4
LT
82 struct xfs_attr_list_context *context);
83
84/*
85 * Routines used for shrinking the Btree.
86 */
517c2220
DC
87int xfs_attr3_leaf_toosmall(struct xfs_da_state *state, int *retval);
88void xfs_attr3_leaf_unbalance(struct xfs_da_state *state,
1da177e4
LT
89 struct xfs_da_state_blk *drop_blk,
90 struct xfs_da_state_blk *save_blk);
1da177e4
LT
91/*
92 * Utility routines.
93 */
1d9025e5
DC
94xfs_dahash_t xfs_attr_leaf_lasthash(struct xfs_buf *bp, int *count);
95int xfs_attr_leaf_order(struct xfs_buf *leaf1_bp,
96 struct xfs_buf *leaf2_bp);
c59f0ad2 97int xfs_attr_leaf_newentsize(struct xfs_da_args *args, int *local);
517c2220 98int xfs_attr3_leaf_read(struct xfs_trans *tp, struct xfs_inode *dp,
d9392a4b
DC
99 xfs_dablk_t bno, xfs_daddr_t mappedbno,
100 struct xfs_buf **bpp);
2f661241
BF
101void xfs_attr3_leaf_hdr_from_disk(struct xfs_da_geometry *geo,
102 struct xfs_attr3_icleaf_hdr *to,
517c2220 103 struct xfs_attr_leafblock *from);
2f661241
BF
104void xfs_attr3_leaf_hdr_to_disk(struct xfs_da_geometry *geo,
105 struct xfs_attr_leafblock *to,
d386b32b 106 struct xfs_attr3_icleaf_hdr *from);
1813dd64 107
1da177e4 108#endif /* __XFS_ATTR_LEAF_H__ */