btrfs: migrate the block group cleanup code
[linux/fpc-iii.git] / fs / xfs / xfs_itable.h
blobe90c1fc5b981a7786d02c8112995fdf78eee8b47
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
4 */
5 #ifndef __XFS_ITABLE_H__
6 #define __XFS_ITABLE_H__
8 /* In-memory representation of a userspace request for batch inode data. */
9 struct xfs_ibulk {
10 struct xfs_mount *mp;
11 void __user *ubuffer; /* user output buffer */
12 xfs_ino_t startino; /* start with this inode */
13 unsigned int icount; /* number of elements in ubuffer */
14 unsigned int ocount; /* number of records returned */
15 unsigned int flags; /* see XFS_IBULK_FLAG_* */
18 /* Only iterate within the same AG as startino */
19 #define XFS_IBULK_SAME_AG (XFS_IWALK_SAME_AG)
21 /* Return value that means we want to abort the walk. */
22 #define XFS_IBULK_ABORT (XFS_IWALK_ABORT)
25 * Advance the user buffer pointer by one record of the given size. If the
26 * buffer is now full, return the appropriate error code.
28 static inline int
29 xfs_ibulk_advance(
30 struct xfs_ibulk *breq,
31 size_t bytes)
33 char __user *b = breq->ubuffer;
35 breq->ubuffer = b + bytes;
36 breq->ocount++;
37 return breq->ocount == breq->icount ? XFS_IBULK_ABORT : 0;
41 * Return stat information in bulk (by-inode) for the filesystem.
44 typedef int (*bulkstat_one_fmt_pf)(struct xfs_ibulk *breq,
45 const struct xfs_bulkstat *bstat);
47 int xfs_bulkstat_one(struct xfs_ibulk *breq, bulkstat_one_fmt_pf formatter);
48 int xfs_bulkstat(struct xfs_ibulk *breq, bulkstat_one_fmt_pf formatter);
49 void xfs_bulkstat_to_bstat(struct xfs_mount *mp, struct xfs_bstat *bs1,
50 const struct xfs_bulkstat *bstat);
52 typedef int (*inumbers_fmt_pf)(struct xfs_ibulk *breq,
53 const struct xfs_inumbers *igrp);
55 int xfs_inumbers(struct xfs_ibulk *breq, inumbers_fmt_pf formatter);
56 void xfs_inumbers_to_inogrp(struct xfs_inogrp *ig1,
57 const struct xfs_inumbers *ig);
59 #endif /* __XFS_ITABLE_H__ */