/* Return stat information in bulk (by-inode) for the filesystem. Special case for non-sequential one inode bulkstat.  */
int xfs_bulkstat_single(xfs_mount_t *mp, xfs_ino_t *lastinop, char __user *buffer, int *done)
/* Return stat information in bulk (by-inode) for the filesystem. Special case for non-sequential one inode bulkstat.  */
int xfs_bulkstat_single(xfs_mount_t *mp, xfs_ino_t *lastinop, char __user *buffer, int *done)
{
	int			count;
	int			error;
	xfs_ino_t		ino;
	int			res;
	ino = (xfs_ino_t)*lastinop;
	error = xfs_bulkstat_one(mp, ino, buffer, sizeof(xfs_bstat_t),
				 NULL, 0, NULL, NULL, &res);
	if (error) {
		(*lastinop)--;
		count = 1;
		if (xfs_bulkstat(mp, lastinop, &count, xfs_bulkstat_one,
				NULL, sizeof(xfs_bstat_t), buffer,
				BULKSTAT_FG_IGET, done))
			return error;
		if (count == 0 || (xfs_ino_t)*lastinop != ino)
			return error == EFSCORRUPTED ?
				XFS_ERROR(EINVAL) : error;
		else
			return 0;
	}
	*done = 0;
	return 0;
}