ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / fs / xfs / xfs_itable.h
1 /*
2  * Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of version 2 of the GNU General Public License as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it would be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  *
12  * Further, this software is distributed without any warranty that it is
13  * free of the rightful claim of any third person regarding infringement
14  * or the like.  Any license provided herein, whether implied or
15  * otherwise, applies only to this software file.  Patent licenses, if
16  * any, provided herein do not apply to combinations of this program with
17  * other software, or any other product whatsoever.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write the Free Software Foundation, Inc., 59
21  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22  *
23  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24  * Mountain View, CA  94043, or:
25  *
26  * http://www.sgi.com
27  *
28  * For further information regarding this notice, see:
29  *
30  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31  */
32 #ifndef __XFS_ITABLE_H__
33 #define __XFS_ITABLE_H__
34
35 /*
36  * xfs_bulkstat() is used to fill in xfs_bstat structures as well as dm_stat
37  * structures (by the dmi library). This is a pointer to a formatter function
38  * that will iget the inode and fill in the appropriate structure.
39  * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
40  */
41 typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
42                                struct xfs_trans *tp,
43                                xfs_ino_t        ino,
44                                void             *buffer,
45                                int              ubsize,
46                                void             *private_data,
47                                xfs_daddr_t      bno,
48                                int              *ubused,
49                                void             *dip,
50                                int              *stat);
51
52 /*
53  * Values for stat return value.
54  */
55 #define BULKSTAT_RV_NOTHING     0
56 #define BULKSTAT_RV_DIDONE      1
57 #define BULKSTAT_RV_GIVEUP      2
58
59 /*
60  * Values for bulkstat flag argument.
61  */
62 #define BULKSTAT_FG_IGET        0x1     /* Go through the buffer cache */
63 #define BULKSTAT_FG_QUICK       0x2     /* No iget, walk the dinode cluster */
64 #define BULKSTAT_FG_VFSLOCKED   0x4     /* Already have vfs lock */
65
66 /*
67  * Return stat information in bulk (by-inode) for the filesystem.
68  */
69 int                                     /* error status */
70 xfs_bulkstat(
71         xfs_mount_t     *mp,            /* mount point for filesystem */
72         xfs_trans_t     *tp,            /* transaction pointer */
73         xfs_ino_t       *lastino,       /* last inode returned */
74         int             *count,         /* size of buffer/count returned */
75         bulkstat_one_pf formatter,      /* func that'd fill a single buf */
76         void            *private_data,  /* private data for formatter */
77         size_t          statstruct_size,/* sizeof struct that we're filling */
78         xfs_caddr_t     ubuffer,        /* buffer with inode stats */
79         int             flags,          /* flag to control access method */
80         int             *done);         /* 1 if there're more stats to get */
81
82 int
83 xfs_bulkstat_single(
84         xfs_mount_t             *mp,
85         xfs_ino_t               *lastinop,
86         xfs_caddr_t             buffer,
87         int                     *done);
88
89 int
90 xfs_bulkstat_one(
91         xfs_mount_t             *mp,
92         xfs_trans_t             *tp,
93         xfs_ino_t               ino,
94         void                    *buffer,
95         int                     ubsize,
96         void                    *private_data,
97         xfs_daddr_t             bno,
98         int                     *ubused,
99         void                    *dibuff,
100         int                     *stat);
101
102 int                                     /* error status */
103 xfs_inumbers(
104         xfs_mount_t             *mp,    /* mount point for filesystem */
105         xfs_trans_t             *tp,    /* transaction pointer */
106         xfs_ino_t               *last,  /* last inode returned */
107         int                     *count, /* size of buffer/count returned */
108         xfs_caddr_t             buffer);/* buffer with inode descriptions */
109
110 #endif  /* __XFS_ITABLE_H__ */