0001
0002
0003
0004
0005 #ifndef __XFS_ITABLE_H__
0006 #define __XFS_ITABLE_H__
0007
0008
0009 struct xfs_ibulk {
0010 struct xfs_mount *mp;
0011 struct user_namespace *mnt_userns;
0012 void __user *ubuffer;
0013 xfs_ino_t startino;
0014 unsigned int icount;
0015 unsigned int ocount;
0016 unsigned int flags;
0017 };
0018
0019
0020 #define XFS_IBULK_SAME_AG (1U << 0)
0021
0022
0023 #define XFS_IBULK_NREXT64 (1U << 1)
0024
0025
0026
0027
0028
0029 static inline int
0030 xfs_ibulk_advance(
0031 struct xfs_ibulk *breq,
0032 size_t bytes)
0033 {
0034 char __user *b = breq->ubuffer;
0035
0036 breq->ubuffer = b + bytes;
0037 breq->ocount++;
0038 return breq->ocount == breq->icount ? -ECANCELED : 0;
0039 }
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 typedef int (*bulkstat_one_fmt_pf)(struct xfs_ibulk *breq,
0054 const struct xfs_bulkstat *bstat);
0055
0056 int xfs_bulkstat_one(struct xfs_ibulk *breq, bulkstat_one_fmt_pf formatter);
0057 int xfs_bulkstat(struct xfs_ibulk *breq, bulkstat_one_fmt_pf formatter);
0058 void xfs_bulkstat_to_bstat(struct xfs_mount *mp, struct xfs_bstat *bs1,
0059 const struct xfs_bulkstat *bstat);
0060
0061 typedef int (*inumbers_fmt_pf)(struct xfs_ibulk *breq,
0062 const struct xfs_inumbers *igrp);
0063
0064 int xfs_inumbers(struct xfs_ibulk *breq, inumbers_fmt_pf formatter);
0065 void xfs_inumbers_to_inogrp(struct xfs_inogrp *ig1,
0066 const struct xfs_inumbers *ig);
0067
0068 #endif