]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - fs/xfs/xfs_itable.h
UBUNTU: Ubuntu-4.13.0-45.50
[mirror_ubuntu-artful-kernel.git] / fs / xfs / xfs_itable.h
CommitLineData
1da177e4
LT
1/*
2 * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
3 *
7b718769
NS
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
1da177e4
LT
6 * published by the Free Software Foundation.
7 *
7b718769
NS
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.
1da177e4 12 *
7b718769
NS
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
1da177e4
LT
16 */
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,
1da177e4 30 int *ubused,
1da177e4
LT
31 int *stat);
32
33/*
34 * Values for stat return value.
35 */
8b56f083
NS
36#define BULKSTAT_RV_NOTHING 0
37#define BULKSTAT_RV_DIDONE 1
38#define BULKSTAT_RV_GIVEUP 2
1da177e4 39
1da177e4
LT
40/*
41 * Return stat information in bulk (by-inode) for the filesystem.
42 */
43int /* error status */
44xfs_bulkstat(
45 xfs_mount_t *mp, /* mount point for filesystem */
46 xfs_ino_t *lastino, /* last inode returned */
47 int *count, /* size of buffer/count returned */
48 bulkstat_one_pf formatter, /* func that'd fill a single buf */
1da177e4
LT
49 size_t statstruct_size,/* sizeof struct that we're filling */
50 char __user *ubuffer,/* buffer with inode stats */
c41564b5 51 int *done); /* 1 if there are more stats to get */
1da177e4 52
faa63e95
MM
53typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */
54 void __user *ubuffer, /* buffer to write to */
65fbaf24 55 int ubsize, /* remaining user buffer sz */
56 int *ubused, /* bytes used by formatter */
faa63e95
MM
57 const xfs_bstat_t *buffer); /* buffer to read from */
58
2ee4fa5c 59int
60xfs_bulkstat_one_int(
61 xfs_mount_t *mp,
62 xfs_ino_t ino,
63 void __user *buffer,
64 int ubsize,
65 bulkstat_one_fmt_pf formatter,
2ee4fa5c 66 int *ubused,
2ee4fa5c 67 int *stat);
68
1da177e4
LT
69int
70xfs_bulkstat_one(
71 xfs_mount_t *mp,
72 xfs_ino_t ino,
73 void __user *buffer,
74 int ubsize,
1da177e4 75 int *ubused,
1da177e4
LT
76 int *stat);
77
faa63e95
MM
78typedef int (*inumbers_fmt_pf)(
79 void __user *ubuffer, /* buffer to write to */
80 const xfs_inogrp_t *buffer, /* buffer to read from */
81 long count, /* # of elements to read */
82 long *written); /* # of bytes written */
83
84int
85xfs_inumbers_fmt(
86 void __user *ubuffer, /* buffer to write to */
87 const xfs_inogrp_t *buffer, /* buffer to read from */
88 long count, /* # of elements to read */
89 long *written); /* # of bytes written */
90
1da177e4
LT
91int /* error status */
92xfs_inumbers(
93 xfs_mount_t *mp, /* mount point for filesystem */
94 xfs_ino_t *last, /* last inode returned */
95 int *count, /* size of buffer/count returned */
faa63e95
MM
96 void __user *buffer, /* buffer with inode info */
97 inumbers_fmt_pf formatter);
1da177e4 98
26788097
DW
99int xfs_internal_inum(struct xfs_mount *mp, xfs_ino_t ino);
100
1da177e4 101#endif /* __XFS_ITABLE_H__ */