blob: e937d9991c1850c5427ecae7419011c8395d09c3 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Nathan Scott7b718762005-11-02 14:58:39 +11002 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
Nathan Scott7b718762005-11-02 14:58:39 +11005 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * published by the Free Software Foundation.
8 *
Nathan Scott7b718762005-11-02 14:58:39 +11009 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 *
Nathan Scott7b718762005-11-02 14:58:39 +110014 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 */
18#ifndef __XFS_DIR2_H__
Christoph Hellwig57926642011-07-13 13:43:48 +020019#define __XFS_DIR2_H__
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100021struct xfs_bmap_free;
Christoph Hellwig57926642011-07-13 13:43:48 +020022struct xfs_da_args;
Linus Torvalds1da177e2005-04-16 15:20:36 -070023struct xfs_inode;
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100024struct xfs_mount;
Linus Torvalds1da177e2005-04-16 15:20:36 -070025struct xfs_trans;
26
Barry Naujok556b8b12008-04-10 12:22:07 +100027extern struct xfs_name xfs_name_dotdot;
28
Linus Torvalds1da177e2005-04-16 15:20:36 -070029/*
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100030 * Generic directory interface routines
31 */
32extern void xfs_dir_startup(void);
33extern void xfs_dir_mount(struct xfs_mount *mp);
34extern int xfs_dir_isempty(struct xfs_inode *dp);
35extern int xfs_dir_init(struct xfs_trans *tp, struct xfs_inode *dp,
36 struct xfs_inode *pdp);
37extern int xfs_dir_createname(struct xfs_trans *tp, struct xfs_inode *dp,
Barry Naujok556b8b12008-04-10 12:22:07 +100038 struct xfs_name *name, xfs_ino_t inum,
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100039 xfs_fsblock_t *first,
40 struct xfs_bmap_free *flist, xfs_extlen_t tot);
41extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp,
Barry Naujok384f3ce2008-05-21 16:58:22 +100042 struct xfs_name *name, xfs_ino_t *inum,
43 struct xfs_name *ci_name);
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100044extern int xfs_dir_removename(struct xfs_trans *tp, struct xfs_inode *dp,
Barry Naujok556b8b12008-04-10 12:22:07 +100045 struct xfs_name *name, xfs_ino_t ino,
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100046 xfs_fsblock_t *first,
47 struct xfs_bmap_free *flist, xfs_extlen_t tot);
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100048extern int xfs_dir_replace(struct xfs_trans *tp, struct xfs_inode *dp,
Barry Naujok556b8b12008-04-10 12:22:07 +100049 struct xfs_name *name, xfs_ino_t inum,
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100050 xfs_fsblock_t *first,
51 struct xfs_bmap_free *flist, xfs_extlen_t tot);
52extern int xfs_dir_canenter(struct xfs_trans *tp, struct xfs_inode *dp,
Barry Naujok556b8b12008-04-10 12:22:07 +100053 struct xfs_name *name, uint resblks);
Nathan Scottf6c2d1f2006-06-20 13:04:51 +100054
55/*
Christoph Hellwig57926642011-07-13 13:43:48 +020056 * Direct call from the bmap code, bypassing the generic directory layer.
Linus Torvalds1da177e2005-04-16 15:20:36 -070057 */
Christoph Hellwig57926642011-07-13 13:43:48 +020058extern int xfs_dir2_sf_to_block(struct xfs_da_args *args);
Barry Naujok384f3ce2008-05-21 16:58:22 +100059
Linus Torvalds1da177e2005-04-16 15:20:36 -070060#endif /* __XFS_DIR2_H__ */