2 * Copyright (c) 2012 Paulo Alcantara <pcacjr@zytor.com>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write the Free Software Foundation,
15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 const void *xfs_dir2_dirblks_get_cached(struct fs_info
*fs
, block_t startblock
,
28 void xfs_dir2_dirblks_flush_cache(void);
30 uint32_t xfs_dir2_da_hashname(const uint8_t *name
, int namelen
);
32 block_t
xfs_dir2_get_right_blk(struct fs_info
*fs
, xfs_dinode_t
*core
,
33 block_t fsblkno
, int *error
);
35 struct inode
*xfs_dir2_local_find_entry(const char *dname
, struct inode
*parent
,
37 struct inode
*xfs_dir2_block_find_entry(const char *dname
, struct inode
*parent
,
39 struct inode
*xfs_dir2_leaf_find_entry(const char *dname
, struct inode
*parent
,
41 struct inode
*xfs_dir2_node_find_entry(const char *dname
, struct inode
*parent
,
44 static inline bool xfs_dir2_isleaf(struct fs_info
*fs
, xfs_dinode_t
*dip
)
49 bmbt_irec_get(&irec
, ((xfs_bmbt_rec_t
*)&dip
->di_literal_area
[0]) +
50 be32_to_cpu(dip
->di_nextents
) - 1);
51 last
= irec
.br_startoff
+ irec
.br_blockcount
;
53 return (last
== XFS_INFO(fs
)->dirleafblk
+ (1 << XFS_INFO(fs
)->dirblklog
));
56 static inline int xfs_dir2_entry_name_cmp(uint8_t *start
, uint8_t *end
,
59 if (!name
|| (strlen(name
) != end
- start
))
63 if (*start
++ != *name
++)
69 #endif /* XFS_DIR2_H_ */