blob: be5f12e07d2217d98814127747d8fc9eadb40cc0 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
3 *
Nathan Scott7b718762005-11-02 14:58:39 +11004 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * published by the Free Software Foundation.
7 *
Nathan Scott7b718762005-11-02 14:58:39 +11008 * 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 *
Nathan Scott7b718762005-11-02 14:58:39 +110013 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 */
17#ifndef __XFS_ITABLE_H__
18#define __XFS_ITABLE_H__
19
20/*
21 * xfs_bulkstat() is used to fill in xfs_bstat structures as well as dm_stat
22 * structures (by the dmi library). This is a pointer to a formatter function
23 * that will iget the inode and fill in the appropriate structure.
24 * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
25 */
26typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
27 xfs_ino_t ino,
28 void __user *buffer,
29 int ubsize,
30 void *private_data,
31 xfs_daddr_t bno,
32 int *ubused,
33 void *dip,
34 int *stat);
35
36/*
37 * Values for stat return value.
38 */
39#define BULKSTAT_RV_NOTHING 0
40#define BULKSTAT_RV_DIDONE 1
41#define BULKSTAT_RV_GIVEUP 2
42
43/*
44 * Values for bulkstat flag argument.
45 */
46#define BULKSTAT_FG_IGET 0x1 /* Go through the buffer cache */
47#define BULKSTAT_FG_QUICK 0x2 /* No iget, walk the dinode cluster */
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49/*
50 * Return stat information in bulk (by-inode) for the filesystem.
51 */
52int /* error status */
53xfs_bulkstat(
54 xfs_mount_t *mp, /* mount point for filesystem */
55 xfs_ino_t *lastino, /* last inode returned */
56 int *count, /* size of buffer/count returned */
57 bulkstat_one_pf formatter, /* func that'd fill a single buf */
58 void *private_data, /* private data for formatter */
59 size_t statstruct_size,/* sizeof struct that we're filling */
60 char __user *ubuffer,/* buffer with inode stats */
61 int flags, /* flag to control access method */
Nathan Scottc41564b2006-03-29 08:55:14 +100062 int *done); /* 1 if there are more stats to get */
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
64int
65xfs_bulkstat_single(
66 xfs_mount_t *mp,
67 xfs_ino_t *lastinop,
68 char __user *buffer,
69 int *done);
70
71int
72xfs_bulkstat_one(
73 xfs_mount_t *mp,
74 xfs_ino_t ino,
75 void __user *buffer,
76 int ubsize,
77 void *private_data,
78 xfs_daddr_t bno,
79 int *ubused,
80 void *dibuff,
81 int *stat);
82
83int /* error status */
84xfs_inumbers(
85 xfs_mount_t *mp, /* mount point for filesystem */
86 xfs_ino_t *last, /* last inode returned */
87 int *count, /* size of buffer/count returned */
88 xfs_inogrp_t __user *buffer);/* buffer with inode info */
89
90#endif /* __XFS_ITABLE_H__ */