void usage(int ret);
static int fsrfile(char *fname, xfs_ino_t ino);
static int fsrfile_common( char *fname, char *tname, char *mnt,
- int fd, xfs_bstat_t *statp);
+ int fd, struct xfs_bstat *statp);
static int packfile(char *fname, char *tname, int fd,
- xfs_bstat_t *statp, struct fsxattr *fsxp);
+ struct xfs_bstat *statp, struct fsxattr *fsxp);
static void fsrdir(char *dirname);
static int fsrfs(char *mntdir, xfs_ino_t ino, int targetrange);
static void initallfs(char *mtab);
char * gettmpname(char *fname);
char * getparent(char *fname);
int fsrprintf(const char *fmt, ...);
-int read_fd_bmap(int, xfs_bstat_t *, int *);
+int read_fd_bmap(int, struct xfs_bstat *, int *);
int cmp(const void *, const void *);
static void tmp_init(char *mnt);
static char * tmp_next(char *mnt);
}
static int
-xfs_bulkstat_single(int fd, xfs_ino_t *lastip, xfs_bstat_t *ubuffer)
+xfs_bulkstat_single(int fd, xfs_ino_t *lastip, struct xfs_bstat *ubuffer)
{
- xfs_fsop_bulkreq_t bulkreq;
+ struct xfs_fsop_bulkreq bulkreq;
bulkreq.lastip = (__u64 *)lastip;
bulkreq.icount = 1;
static int
xfs_bulkstat(int fd, xfs_ino_t *lastip, int icount,
- xfs_bstat_t *ubuffer, __s32 *ocount)
+ struct xfs_bstat *ubuffer, __s32 *ocount)
{
- xfs_fsop_bulkreq_t bulkreq;
+ struct xfs_fsop_bulkreq bulkreq;
bulkreq.lastip = (__u64 *)lastip;
bulkreq.icount = icount;
int count = 0;
int ret;
__s32 buflenout;
- xfs_bstat_t buf[GRABSZ];
+ struct xfs_bstat buf[GRABSZ];
char fname[64];
char *tname;
jdm_fshandle_t *fshandlep;
while ((ret = xfs_bulkstat(fsfd,
&lastino, GRABSZ, &buf[0], &buflenout)) == 0) {
- xfs_bstat_t *p;
- xfs_bstat_t *endp;
+ struct xfs_bstat *p;
+ struct xfs_bstat *endp;
if (buflenout == 0)
goto out0;
int
cmp(const void *s1, const void *s2)
{
- return( ((xfs_bstat_t *)s2)->bs_extents -
- ((xfs_bstat_t *)s1)->bs_extents);
+ return( ((struct xfs_bstat *)s2)->bs_extents -
+ ((struct xfs_bstat *)s1)->bs_extents);
}
static int
fsrfile(char *fname, xfs_ino_t ino)
{
- xfs_bstat_t statbuf;
+ struct xfs_bstat statbuf;
jdm_fshandle_t *fshandlep;
int fd = -1, fsfd = -1;
int error = -1;
char *tname,
char *fsname,
int fd,
- xfs_bstat_t *statp)
+ struct xfs_bstat *statp)
{
int error;
struct statvfs vfss;
fsr_setup_attr_fork(
int fd,
int tfd,
- xfs_bstat_t *bstatp)
+ struct xfs_bstat *bstatp)
{
#ifdef HAVE_FSETXATTR
struct stat tstatbuf;
i = 0;
do {
- xfs_bstat_t tbstat;
+ struct xfs_bstat tbstat;
xfs_ino_t ino;
char name[64];
*/
static int
packfile(char *fname, char *tname, int fd,
- xfs_bstat_t *statp, struct fsxattr *fsxp)
+ struct xfs_bstat *statp, struct fsxattr *fsxp)
{
int tfd = -1;
int srval;
#define MAPSIZE 128
#define OUTMAP_SIZE_INCREMENT MAPSIZE
-int read_fd_bmap(int fd, xfs_bstat_t *sin, int *cur_nextents)
+int read_fd_bmap(int fd, struct xfs_bstat *sin, int *cur_nextents)
{
int i, cnt;
struct getbmap map[MAPSIZE];
extern intgen_t
jdm_attr_multi( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
char *bufp, int rtrvcnt, int flags);
extern intgen_t
jdm_attr_list( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
char *bufp, size_t bufsz, int flags,
struct attrlist_cursor *cursor);
extern int
jdm_parents( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
struct parent *bufp, size_t bufsz,
unsigned int *count);
extern int
jdm_parentpaths( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
struct parent *bufp, size_t bufsz,
unsigned int *count);
int nent;
int i;
__u64 last = 0;
- xfs_inogrp_t *t;
- xfs_fsop_bulkreq_t bulkreq;
+ struct xfs_inogrp *t;
+ struct xfs_fsop_bulkreq bulkreq;
if (argc != 2)
nent = 1;
* check out a parent entry to see if the values seem valid
*/
static void
-check_parent_entry(xfs_bstat_t *bstatp, parent_t *parent)
+check_parent_entry(struct xfs_bstat *bstatp, parent_t *parent)
{
int sts;
char fullpath[PATH_MAX];
static void
check_parents(parent_t *parentbuf, size_t *parentbuf_size,
- jdm_fshandle_t *fshandlep, xfs_bstat_t *statp)
+ jdm_fshandle_t *fshandlep, struct xfs_bstat *statp)
{
int error, i;
__u32 count;
}
static int
-do_bulkstat(parent_t *parentbuf, size_t *parentbuf_size, xfs_bstat_t *bstatbuf,
- int fsfd, jdm_fshandle_t *fshandlep)
+do_bulkstat(parent_t *parentbuf, size_t *parentbuf_size,
+ struct xfs_bstat *bstatbuf, int fsfd, jdm_fshandle_t *fshandlep)
{
__s32 buflenout;
__u64 lastino = 0;
- xfs_bstat_t *p;
- xfs_bstat_t *endp;
- xfs_fsop_bulkreq_t bulkreq;
+ struct xfs_bstat *p;
+ struct xfs_bstat *endp;
+ struct xfs_fsop_bulkreq bulkreq;
struct stat mntstat;
if (stat(mntpt, &mntstat)) {
jdm_fshandle_t *fshandlep;
parent_t *parentbuf;
size_t parentbuf_size = PARENTBUF_SZ;
- xfs_bstat_t *bstatbuf;
+ struct xfs_bstat *bstatbuf;
err_status = 0;
inodes_checked = 0;
}
/* allocate buffers */
- bstatbuf = (xfs_bstat_t *)calloc(BSTATBUF_SZ, sizeof(xfs_bstat_t));
+ bstatbuf = (struct xfs_bstat *)calloc(BSTATBUF_SZ, sizeof(struct xfs_bstat));
parentbuf = (parent_t *)malloc(parentbuf_size);
if (!bstatbuf || !parentbuf) {
fprintf(stderr, _("unable to allocate buffers: %s\n"),
static void
jdm_fill_filehandle( filehandle_t *handlep,
fshandle_t *fshandlep,
- xfs_bstat_t *statp )
+ struct xfs_bstat *statp)
{
handlep->fh_fshandle = *fshandlep;
handlep->fh_sz_following = FILEHANDLE_SZ_FOLLOWING;
jdm_new_filehandle( jdm_filehandle_t **handlep,
size_t *hlen,
jdm_fshandle_t *fshandlep,
- xfs_bstat_t *statp)
+ struct xfs_bstat *statp)
{
/* allocate and fill filehandle */
*hlen = sizeof(filehandle_t);
}
intgen_t
-jdm_open( jdm_fshandle_t *fshp, xfs_bstat_t *statp, intgen_t oflags )
+jdm_open( jdm_fshandle_t *fshp, struct xfs_bstat *statp, intgen_t oflags )
{
fshandle_t *fshandlep = ( fshandle_t * )fshp;
filehandle_t filehandle;
intgen_t
jdm_readlink( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
char *bufp, size_t bufsz )
{
fshandle_t *fshandlep = ( fshandle_t * )fshp;
int
jdm_attr_multi( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
char *bufp, int rtrvcnt, int flags)
{
fshandle_t *fshandlep = ( fshandle_t * )fshp;
int
jdm_attr_list( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
char *bufp, size_t bufsz, int flags,
struct attrlist_cursor *cursor)
{
int
jdm_parents( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
parent_t *bufp, size_t bufsz,
unsigned int *count)
{
int
jdm_parentpaths( jdm_fshandle_t *fshp,
- xfs_bstat_t *statp,
+ struct xfs_bstat *statp,
parent_t *bufp, size_t bufsz,
unsigned int *count)
{
* For use by backup and restore programs to set the XFS on-disk inode
* fields di_dmevmask and di_dmstate. These must be set to exactly and
* only values previously obtained via xfs_bulkstat! (Specifically the
- * xfs_bstat_t fields bs_dmevmask and bs_dmstate.)
+ * struct xfs_bstat fields bs_dmevmask and bs_dmstate.)
*/
#ifndef HAVE_FSDMIDATA
struct fsdmidata {
__s32 tv_nsec; /* and nanoseconds */
} xfs_bstime_t;
-typedef struct xfs_bstat {
+struct xfs_bstat {
__u64 bs_ino; /* inode number */
__u16 bs_mode; /* type and mode */
__u16 bs_nlink; /* number of links */
__u32 bs_dmevmask; /* DMIG event mask */
__u16 bs_dmstate; /* DMIG state info */
__u16 bs_aextents; /* attribute number of extents */
-} xfs_bstat_t;
+};
/* bs_sick flags */
#define XFS_BS_SICK_INODE (1 << 0) /* inode core */
/*
* The user-level BulkStat Request interface structure.
*/
-typedef struct xfs_fsop_bulkreq {
+struct xfs_fsop_bulkreq {
__u64 __user *lastip; /* last inode # pointer */
__s32 icount; /* count of entries in buffer */
void __user *ubuffer;/* user buffer for inode desc. */
__s32 __user *ocount; /* output count pointer */
-} xfs_fsop_bulkreq_t;
+};
/*
* Structures returned from xfs_inumbers routine (XFS_IOC_FSINUMBERS).
*/
-typedef struct xfs_inogrp {
+struct xfs_inogrp {
__u64 xi_startino; /* starting inode number */
__s32 xi_alloccount; /* # bits set in allocmask */
__u64 xi_allocmask; /* mask of allocated inodes */
-} xfs_inogrp_t;
+};
/*
xfs_off_t sx_offset; /* offset into file */
xfs_off_t sx_length; /* leng from offset */
char sx_pad[16]; /* pad space, unused */
- xfs_bstat_t sx_stat; /* stat of target b4 copy */
+ struct xfs_bstat sx_stat; /* stat of target b4 copy */
} xfs_swapext_t;
/*
static void
quot_bulkstat_add(
- xfs_bstat_t *p,
+ struct xfs_bstat *p,
uint flags)
{
du_t *dp;
char *fsdir,
uint flags)
{
- xfs_fsop_bulkreq_t bulkreq;
- xfs_bstat_t *buf;
+ struct xfs_fsop_bulkreq bulkreq;
+ struct xfs_bstat *buf;
__u64 last = 0;
__s32 count;
int i, sts, fsfd;
return;
}
- buf = (xfs_bstat_t *)calloc(NBSTAT, sizeof(xfs_bstat_t));
+ buf = (struct xfs_bstat *)calloc(NBSTAT, sizeof(struct xfs_bstat));
if (!buf) {
perror("calloc");
close(fsfd);