| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2005-11-02 14:58:39 +11:00
										 |  |  |  * Copyright (c) 2000,2002-2003,2005 Silicon Graphics, Inc. | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  |  * Copyright (c) 2013 Red Hat, Inc. | 
					
						
							| 
									
										
										
										
											2005-11-02 10:33:33 +11:00
										 |  |  |  * All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-11-02 14:58:39 +11:00
										 |  |  |  * This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU General Public License as | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * published by the Free Software Foundation. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-11-02 14:58:39 +11:00
										 |  |  |  * This program is distributed in the hope that it would be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-11-02 14:58:39 +11:00
										 |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write the Free Software Foundation, | 
					
						
							|  |  |  |  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  */ | 
					
						
							|  |  |  | #ifndef __XFS_ATTR_LEAF_H__
 | 
					
						
							|  |  |  | #define	__XFS_ATTR_LEAF_H__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct attrlist; | 
					
						
							|  |  |  | struct attrlist_cursor_kern; | 
					
						
							| 
									
										
										
										
											2008-06-23 13:23:48 +10:00
										 |  |  | struct xfs_attr_list_context; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | struct xfs_da_args; | 
					
						
							|  |  |  | struct xfs_da_state; | 
					
						
							|  |  |  | struct xfs_da_state_blk; | 
					
						
							|  |  |  | struct xfs_inode; | 
					
						
							|  |  |  | struct xfs_trans; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Used to keep a list of "remote value" extents when unlinking an inode. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | typedef struct xfs_attr_inactive_list { | 
					
						
							|  |  |  | 	xfs_dablk_t	valueblk;	/* block number of value bytes */ | 
					
						
							|  |  |  | 	int		valuelen;	/* number of bytes in value */ | 
					
						
							|  |  |  | } xfs_attr_inactive_list_t; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*========================================================================
 | 
					
						
							|  |  |  |  * Function prototypes for the kernel. | 
					
						
							|  |  |  |  *========================================================================*/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2005-11-02 10:34:53 +11:00
										 |  |  |  * Internal routines when attribute fork size < XFS_LITINO(mp). | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2005-11-02 10:34:53 +11:00
										 |  |  | void	xfs_attr_shortform_create(struct xfs_da_args *args); | 
					
						
							|  |  |  | void	xfs_attr_shortform_add(struct xfs_da_args *args, int forkoff); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | int	xfs_attr_shortform_lookup(struct xfs_da_args *args); | 
					
						
							|  |  |  | int	xfs_attr_shortform_getvalue(struct xfs_da_args *args); | 
					
						
							|  |  |  | int	xfs_attr_shortform_to_leaf(struct xfs_da_args *args); | 
					
						
							| 
									
										
										
										
											2005-11-02 10:34:53 +11:00
										 |  |  | int	xfs_attr_shortform_remove(struct xfs_da_args *args); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | int	xfs_attr_shortform_list(struct xfs_attr_list_context *context); | 
					
						
							| 
									
										
										
										
											2012-06-22 18:50:14 +10:00
										 |  |  | int	xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp); | 
					
						
							| 
									
										
										
										
											2005-11-02 10:34:53 +11:00
										 |  |  | int	xfs_attr_shortform_bytesfit(xfs_inode_t *dp, int bytes); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2005-11-02 10:34:53 +11:00
										 |  |  |  * Internal routines when attribute fork size == XFS_LBSIZE(mp). | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_to_node(struct xfs_da_args *args); | 
					
						
							|  |  |  | int	xfs_attr3_leaf_to_shortform(struct xfs_buf *bp, | 
					
						
							| 
									
										
										
										
											2005-11-02 10:34:53 +11:00
										 |  |  | 				   struct xfs_da_args *args, int forkoff); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_clearflag(struct xfs_da_args *args); | 
					
						
							|  |  |  | int	xfs_attr3_leaf_setflag(struct xfs_da_args *args); | 
					
						
							|  |  |  | int	xfs_attr3_leaf_flipflags(struct xfs_da_args *args); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Routines used for growing the Btree. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_split(struct xfs_da_state *state, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 				   struct xfs_da_state_blk *oldblk, | 
					
						
							|  |  |  | 				   struct xfs_da_state_blk *newblk); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_lookup_int(struct xfs_buf *leaf, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 					struct xfs_da_args *args); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_getvalue(struct xfs_buf *bp, struct xfs_da_args *args); | 
					
						
							|  |  |  | int	xfs_attr3_leaf_add(struct xfs_buf *leaf_buffer, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 				 struct xfs_da_args *args); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_remove(struct xfs_buf *leaf_buffer, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 				    struct xfs_da_args *args); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_list_int(struct xfs_buf *bp, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 				      struct xfs_attr_list_context *context); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Routines used for shrinking the Btree. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_toosmall(struct xfs_da_state *state, int *retval); | 
					
						
							|  |  |  | void	xfs_attr3_leaf_unbalance(struct xfs_da_state *state, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 				       struct xfs_da_state_blk *drop_blk, | 
					
						
							|  |  |  | 				       struct xfs_da_state_blk *save_blk); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_root_inactive(struct xfs_trans **trans, struct xfs_inode *dp); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Utility routines. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2012-06-22 18:50:14 +10:00
										 |  |  | xfs_dahash_t	xfs_attr_leaf_lasthash(struct xfs_buf *bp, int *count); | 
					
						
							|  |  |  | int	xfs_attr_leaf_order(struct xfs_buf *leaf1_bp, | 
					
						
							|  |  |  | 				   struct xfs_buf *leaf2_bp); | 
					
						
							| 
									
										
										
										
											2005-11-02 10:33:33 +11:00
										 |  |  | int	xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 					int *local); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | int	xfs_attr3_leaf_read(struct xfs_trans *tp, struct xfs_inode *dp, | 
					
						
							| 
									
										
										
										
											2012-11-12 22:54:17 +11:00
										 |  |  | 			xfs_dablk_t bno, xfs_daddr_t mappedbno, | 
					
						
							|  |  |  | 			struct xfs_buf **bpp); | 
					
						
							| 
									
										
										
										
											2013-04-24 18:58:55 +10:00
										 |  |  | void	xfs_attr3_leaf_hdr_from_disk(struct xfs_attr3_icleaf_hdr *to, | 
					
						
							|  |  |  | 				     struct xfs_attr_leafblock *from); | 
					
						
							| 
									
										
										
										
											2013-08-12 20:49:31 +10:00
										 |  |  | void	xfs_attr3_leaf_hdr_to_disk(struct xfs_attr_leafblock *to, | 
					
						
							|  |  |  | 				   struct xfs_attr3_icleaf_hdr *from); | 
					
						
							| 
									
										
										
										
											2012-11-14 17:54:40 +11:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif	/* __XFS_ATTR_LEAF_H__ */
 |