Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 693296 | Differences between
and this patch

Collapse All | Expand All

(-)a/common/content_inode.h (-2 / +2 lines)
Lines 150-157 typedef struct timestruct timestruct_t; Link Here
150
150
151
/* bstat_t - bulk stat structure
151
/* bstat_t - bulk stat structure
152
 *
152
 *
153
 * used in filehdr_t below. derived from xfs_bstat_t, to achieve independence
153
 * used in filehdr_t below. derived from struct xfs_bstat, to achieve independence
154
 * from changes to xfs_bstat_t.
154
 * from changes to struct xfs_bstat.
155
 */
155
 */
156
#define BSTAT_SZ	128
156
#define BSTAT_SZ	128
157
#define MODE_SZ		4
157
#define MODE_SZ		4
(-)a/common/hsmapi.c (-9 / +9 lines)
Lines 108-114 typedef struct { Link Here
108
#define	DM_EVENT_TRUNCATE	18
108
#define	DM_EVENT_TRUNCATE	18
109
#define	DM_EVENT_DESTROY	20
109
#define	DM_EVENT_DESTROY	20
110
110
111
 /* Interesting bit combinations within the bs_dmevmask field of xfs_bstat_t:
111
 /* Interesting bit combinations within the bs_dmevmask field of struct xfs_bstat:
112
 * OFL, UNM, and PAR files have exactly these bits set.
112
 * OFL, UNM, and PAR files have exactly these bits set.
113
 * DUL and MIG files have all but the DM_EVENT_READ bit set */
113
 * DUL and MIG files have all but the DM_EVENT_READ bit set */
114
#define DMF_EV_BITS	((1<<DM_EVENT_DESTROY) | \
114
#define DMF_EV_BITS	((1<<DM_EVENT_DESTROY) | \
Lines 270-276 extern int Link Here
270
HsmEstimateFileSpace(
270
HsmEstimateFileSpace(
271
	hsm_fs_ctxt_t	*fscontextp,
271
	hsm_fs_ctxt_t	*fscontextp,
272
	hsm_f_ctxt_t	*fcontextp,
272
	hsm_f_ctxt_t	*fcontextp,
273
const	xfs_bstat_t	*statp,
273
const	struct xfs_bstat	*statp,
274
	off64_t		*bytes,
274
	off64_t		*bytes,
275
	int		accurate)
275
	int		accurate)
276
{
276
{
Lines 353-359 const xfs_bstat_t *statp, Link Here
353
extern int
353
extern int
354
HsmEstimateFileOffset(
354
HsmEstimateFileOffset(
355
	hsm_fs_ctxt_t	*contextp,
355
	hsm_fs_ctxt_t	*contextp,
356
const	xfs_bstat_t	*statp,
356
const	struct xfs_bstat	*statp,
357
	off64_t		bytecount,
357
	off64_t		bytecount,
358
	off64_t		*byteoffset)
358
	off64_t		*byteoffset)
359
{
359
{
Lines 458-464 HsmDeleteFileContext( Link Here
458
extern int
458
extern int
459
HsmInitFileContext(
459
HsmInitFileContext(
460
	hsm_f_ctxt_t	*contextp,
460
	hsm_f_ctxt_t	*contextp,
461
const	xfs_bstat_t	*statp)
461
const	struct xfs_bstat	*statp)
462
{
462
{
463
	dmf_f_ctxt_t	*dmf_f_ctxtp = (dmf_f_ctxt_t *)contextp;
463
	dmf_f_ctxt_t	*dmf_f_ctxtp = (dmf_f_ctxt_t *)contextp;
464
	XFSattrvalue0_t	*dmfattrp;
464
	XFSattrvalue0_t	*dmfattrp;
Lines 492-498 const xfs_bstat_t *statp) Link Here
492
	attr_op.am_flags     = ATTR_ROOT;
492
	attr_op.am_flags     = ATTR_ROOT;
493
493
494
	error = jdm_attr_multi(dmf_f_ctxtp->fsys.fshanp,
494
	error = jdm_attr_multi(dmf_f_ctxtp->fsys.fshanp,
495
			       (xfs_bstat_t *)statp,
495
			       (struct xfs_bstat *)statp,
496
			       (char *)&attr_op,
496
			       (char *)&attr_op,
497
			       1,
497
			       1,
498
			       0);
498
			       0);
Lines 538-559 const xfs_bstat_t *statp) Link Here
538
538
539
/******************************************************************************
539
/******************************************************************************
540
* Name
540
* Name
541
*	HsmModifyInode - modify a xfs_bstat_t to make a file appear offline
541
*	HsmModifyInode - modify a struct xfs_bstat to make a file appear offline
542
*
542
*
543
* Description
543
* Description
544
*	HsmModifyInode uses the context provided by a previous
544
*	HsmModifyInode uses the context provided by a previous
545
*	HsmInitFileContext call to determine how to modify a xfs_bstat_t
545
*	HsmInitFileContext call to determine how to modify a struct xfs_bstat
546
*	structure to make a dual-residency HSM file appear to be offline.
546
*	structure to make a dual-residency HSM file appear to be offline.
547
*
547
*
548
* Returns
548
* Returns
549
*	!= 0, xfs_bstat_t structure was modified.
549
*	!= 0, struct xfs_bstat structure was modified.
550
*	== 0, if something is wrong with the file and it should not be dumped.
550
*	== 0, if something is wrong with the file and it should not be dumped.
551
******************************************************************************/
551
******************************************************************************/
552
552
553
extern int
553
extern int
554
HsmModifyInode(
554
HsmModifyInode(
555
	hsm_f_ctxt_t	*contextp,
555
	hsm_f_ctxt_t	*contextp,
556
	xfs_bstat_t	*statp)
556
	struct xfs_bstat	*statp)
557
{
557
{
558
	dmf_f_ctxt_t	*dmf_f_ctxtp = (dmf_f_ctxt_t *)contextp;
558
	dmf_f_ctxt_t	*dmf_f_ctxtp = (dmf_f_ctxt_t *)contextp;
559
559
(-)a/common/hsmapi.h (-3 / +3 lines)
Lines 186-200 const struct xfs_bstat *statp); Link Here
186
186
187
/******************************************************************************
187
/******************************************************************************
188
* Name
188
* Name
189
*	HsmModifyInode - modify a xfs_bstat_t to make a file appear offline
189
*	HsmModifyInode - modify a struct xfs_bstat to make a file appear offline
190
*
190
*
191
* Description
191
* Description
192
*	HsmModifyInode uses the context provided by a previous
192
*	HsmModifyInode uses the context provided by a previous
193
*	HsmInitFileContext call to determine how to modify a xfs_bstat_t
193
*	HsmInitFileContext call to determine how to modify a struct xfs_bstat
194
*	structure to make a dual-residency HSM file appear to be offline.
194
*	structure to make a dual-residency HSM file appear to be offline.
195
*
195
*
196
* Returns
196
* Returns
197
*	!= 0, xfs_bstat_t structure was modified.
197
*	!= 0, struct xfs_bstat structure was modified.
198
*	== 0, if something is wrong with the file and it should not be dumped.
198
*	== 0, if something is wrong with the file and it should not be dumped.
199
******************************************************************************/
199
******************************************************************************/
200
200
(-)a/common/util.c (-15 / +15 lines)
Lines 125-138 bigstat_iter(jdm_fshandle_t *fshandlep, Link Here
125
	      void * seek_arg1,
125
	      void * seek_arg1,
126
	      int *statp,
126
	      int *statp,
127
	      bool_t (pfp)(int),
127
	      bool_t (pfp)(int),
128
	      xfs_bstat_t *buf,
128
	      struct xfs_bstat *buf,
129
	      size_t buflenin)
129
	      size_t buflenin)
130
{
130
{
131
	__s32 buflenout;
131
	__s32 buflenout;
132
	xfs_ino_t lastino;
132
	xfs_ino_t lastino;
133
	int saved_errno;
133
	int saved_errno;
134
	int bulkstatcnt;
134
	int bulkstatcnt;
135
        xfs_fsop_bulkreq_t bulkreq;
135
        struct xfs_fsop_bulkreq bulkreq;
136
136
137
	/* stat set with return from callback func
137
	/* stat set with return from callback func
138
	 */
138
	 */
Lines 162-169 bigstat_iter(jdm_fshandle_t *fshandlep, Link Here
162
	bulkreq.ubuffer = buf;
162
	bulkreq.ubuffer = buf;
163
	bulkreq.ocount = &buflenout;
163
	bulkreq.ocount = &buflenout;
164
	while (!ioctl(fsfd, XFS_IOC_FSBULKSTAT, &bulkreq)) {
164
	while (!ioctl(fsfd, XFS_IOC_FSBULKSTAT, &bulkreq)) {
165
		xfs_bstat_t *p;
165
		struct xfs_bstat *p;
166
		xfs_bstat_t *endp;
166
		struct xfs_bstat *endp;
167
167
168
		if (buflenout == 0) {
168
		if (buflenout == 0) {
169
			mlog(MLOG_NITTY + 1,
169
			mlog(MLOG_NITTY + 1,
Lines 254-262 bigstat_iter(jdm_fshandle_t *fshandlep, Link Here
254
int
254
int
255
bigstat_one(int fsfd,
255
bigstat_one(int fsfd,
256
	     xfs_ino_t ino,
256
	     xfs_ino_t ino,
257
	     xfs_bstat_t *statp)
257
	     struct xfs_bstat *statp)
258
{
258
{
259
        xfs_fsop_bulkreq_t bulkreq;
259
        struct xfs_fsop_bulkreq bulkreq;
260
	int count = 0;
260
	int count = 0;
261
261
262
	assert(ino > 0);
262
	assert(ino > 0);
Lines 274-296 int Link Here
274
inogrp_iter(int fsfd,
274
inogrp_iter(int fsfd,
275
	     int (*fp)(void *arg1,
275
	     int (*fp)(void *arg1,
276
				int fsfd,
276
				int fsfd,
277
				xfs_inogrp_t *inogrp),
277
				struct xfs_inogrp *inogrp),
278
	     void * arg1,
278
	     void * arg1,
279
	     int *statp)
279
	     int *statp)
280
{
280
{
281
	xfs_ino_t lastino;
281
	xfs_ino_t lastino;
282
	int inogrpcnt;
282
	int inogrpcnt;
283
	xfs_inogrp_t *igrp;
283
	struct xfs_inogrp *igrp;
284
        xfs_fsop_bulkreq_t bulkreq;
284
        struct xfs_fsop_bulkreq bulkreq;
285
285
286
	/* stat set with return from callback func */
286
	/* stat set with return from callback func */
287
	*statp = 0;
287
	*statp = 0;
288
288
289
	igrp = malloc(INOGRPLEN * sizeof(xfs_inogrp_t));
289
	igrp = malloc(INOGRPLEN * sizeof(struct xfs_inogrp));
290
	if (!igrp) {
290
	if (!igrp) {
291
		mlog(MLOG_NORMAL | MLOG_ERROR,
291
		mlog(MLOG_NORMAL | MLOG_ERROR,
292
		     _("malloc of stream context failed (%d bytes): %s\n"),
292
		     _("malloc of stream context failed (%d bytes): %s\n"),
293
		     INOGRPLEN * sizeof(xfs_inogrp_t),
293
		     INOGRPLEN * sizeof(struct xfs_inogrp),
294
		     strerror(errno));
294
		     strerror(errno));
295
		return -1;
295
		return -1;
296
	}
296
	}
Lines 302-308 inogrp_iter(int fsfd, Link Here
302
	bulkreq.ubuffer = igrp;
302
	bulkreq.ubuffer = igrp;
303
	bulkreq.ocount = &inogrpcnt;
303
	bulkreq.ocount = &inogrpcnt;
304
	while (!ioctl(fsfd, XFS_IOC_FSINUMBERS, &bulkreq)) {
304
	while (!ioctl(fsfd, XFS_IOC_FSINUMBERS, &bulkreq)) {
305
		xfs_inogrp_t *p, *endp;
305
		struct xfs_inogrp *p, *endp;
306
306
307
		if (inogrpcnt == 0) {
307
		if (inogrpcnt == 0) {
308
			free(igrp);
308
			free(igrp);
Lines 339-349 inogrp_iter(int fsfd, Link Here
339
int
339
int
340
diriter(jdm_fshandle_t *fshandlep,
340
diriter(jdm_fshandle_t *fshandlep,
341
	 int fsfd,
341
	 int fsfd,
342
	 xfs_bstat_t *statp,
342
	 struct xfs_bstat *statp,
343
	 int (*cbfp)(void *arg1,
343
	 int (*cbfp)(void *arg1,
344
			     jdm_fshandle_t *fshandlep,
344
			     jdm_fshandle_t *fshandlep,
345
			     int fsfd,
345
			     int fsfd,
346
			     xfs_bstat_t *statp,
346
			     struct xfs_bstat *statp,
347
			     char *namep),
347
			     char *namep),
348
	 void *arg1,
348
	 void *arg1,
349
	 int *cbrvalp,
349
	 int *cbrvalp,
Lines 428-434 diriter(jdm_fshandle_t *fshandlep, Link Here
428
		      assert(nread >= 0),
428
		      assert(nread >= 0),
429
		      p = (struct dirent *)((char *)p + reclen),
429
		      p = (struct dirent *)((char *)p + reclen),
430
		      reclen = (size_t)p->d_reclen) {
430
		      reclen = (size_t)p->d_reclen) {
431
			xfs_bstat_t statbuf;
431
			struct xfs_bstat statbuf;
432
			assert(scrval == 0);
432
			assert(scrval == 0);
433
			assert(cbrval == 0);
433
			assert(cbrval == 0);
434
434
(-)a/common/util.h (-6 / +6 lines)
Lines 87-93 extern char *strncpyterm(char *s1, char *s2, size_t n); Link Here
87
typedef int (*bstat_cbfp_t)(void *arg1,
87
typedef int (*bstat_cbfp_t)(void *arg1,
88
				 jdm_fshandle_t *fshandlep,
88
				 jdm_fshandle_t *fshandlep,
89
				 int fsfd,
89
				 int fsfd,
90
				 xfs_bstat_t *statp);
90
				 struct xfs_bstat *statp);
91
91
92
typedef xfs_ino_t (*bstat_seekfp_t)(void *arg1,
92
typedef xfs_ino_t (*bstat_seekfp_t)(void *arg1,
93
				    xfs_ino_t lastino);
93
				    xfs_ino_t lastino);
Lines 102-118 extern int bigstat_iter(jdm_fshandle_t *fshandlep, Link Here
102
			      void * seek_arg1,
102
			      void * seek_arg1,
103
			      int *statp,
103
			      int *statp,
104
			      bool_t (pfp)(int), /* preemption chk func */
104
			      bool_t (pfp)(int), /* preemption chk func */
105
			      xfs_bstat_t *buf,
105
			      struct xfs_bstat *buf,
106
			      size_t buflen);
106
			      size_t buflen);
107
107
108
extern int bigstat_one(int fsfd,
108
extern int bigstat_one(int fsfd,
109
			     xfs_ino_t ino,
109
			     xfs_ino_t ino,
110
			     xfs_bstat_t *statp);
110
			     struct xfs_bstat *statp);
111
111
112
extern int inogrp_iter(int fsfd,
112
extern int inogrp_iter(int fsfd,
113
			     int (*fp)(void *arg1,
113
			     int (*fp)(void *arg1,
114
				     		int fsfd,
114
				     		int fsfd,
115
						xfs_inogrp_t *inogrp),
115
						struct xfs_inogrp *inogrp),
116
			     void * arg1,
116
			     void * arg1,
117
			     int *statp);
117
			     int *statp);
118
118
Lines 131-141 extern int inogrp_iter(int fsfd, Link Here
131
 */
131
 */
132
extern int diriter(jdm_fshandle_t *fshandlep,
132
extern int diriter(jdm_fshandle_t *fshandlep,
133
			 int fsfd,
133
			 int fsfd,
134
			 xfs_bstat_t *statp,
134
			 struct xfs_bstat *statp,
135
			 int (*cbfp)(void *arg1,
135
			 int (*cbfp)(void *arg1,
136
					     jdm_fshandle_t *fshandlep,
136
					     jdm_fshandle_t *fshandlep,
137
					     int fsfd,
137
					     int fsfd,
138
					     xfs_bstat_t *statp,
138
					     struct xfs_bstat *statp,
139
					     char *namep),
139
					     char *namep),
140
			 void *arg1,
140
			 void *arg1,
141
			 int *cbrvalp,
141
			 int *cbrvalp,
(-)a/doc/xfsdump.html (-3 / +3 lines)
Lines 513-521 create inode-ranges for multi-stream dumps if pertinent. Link Here
513
      - bigstat_init on cb_add()
513
      - bigstat_init on cb_add()
514
	  - loops doing bulkstats (using syssgi() or ioctl())
514
	  - loops doing bulkstats (using syssgi() or ioctl())
515
	    until system call returns non-zero value
515
	    until system call returns non-zero value
516
	  - each bulkstat returns a buffer of xfs_bstat_t records
516
	  - each bulkstat returns a buffer of struct xfs_bstat records
517
	    (buffer of size bulkreq.ocount)
517
	    (buffer of size bulkreq.ocount)
518
	  - loop thru each xfs_bstat_t record for an inode  
518
	  - loop thru each struct xfs_bstat record for an inode  
519
	    calling cb_add()
519
	    calling cb_add()
520
	  * cb_add
520
	  * cb_add
521
	    - looks at latest mtime|ctime and 
521
	    - looks at latest mtime|ctime and 
Lines 629-635 create inode-ranges for multi-stream dumps if pertinent. Link Here
629
        * dump_filehdr()
629
        * dump_filehdr()
630
          - write out 256 padded file header
630
          - write out 256 padded file header
631
          - header = &lt;offset, flags, checksum, 128-byte bulk stat structure &gt;
631
          - header = &lt;offset, flags, checksum, 128-byte bulk stat structure &gt;
632
          - bulkstat struct derived from xfs_bstat_t 
632
          - bulkstat struct derived from struct xfs_bstat 
633
            - stnd. stat stuff + extent size, #of extents, DMI stuff
633
            - stnd. stat stuff + extent size, #of extents, DMI stuff
634
          - if HSM context then 
634
          - if HSM context then 
635
            - modify bstat struct to make it offline
635
            - modify bstat struct to make it offline
(-)a/dump/content.c (-38 / +38 lines)
Lines 262-291 extern size_t pgsz; Link Here
262
/* file dumpers
262
/* file dumpers
263
 */
263
 */
264
static rv_t dump_dirs(ix_t strmix,
264
static rv_t dump_dirs(ix_t strmix,
265
		       xfs_bstat_t *bstatbufp,
265
		       struct xfs_bstat *bstatbufp,
266
		       size_t bstatbuflen,
266
		       size_t bstatbuflen,
267
		       void *inomap_contextp);
267
		       void *inomap_contextp);
268
static rv_t dump_dir(ix_t strmix,
268
static rv_t dump_dir(ix_t strmix,
269
		      jdm_fshandle_t *,
269
		      jdm_fshandle_t *,
270
		      int,
270
		      int,
271
		      xfs_bstat_t *);
271
		      struct xfs_bstat *);
272
static rv_t dump_file(void *,
272
static rv_t dump_file(void *,
273
		       jdm_fshandle_t *,
273
		       jdm_fshandle_t *,
274
		       int,
274
		       int,
275
		       xfs_bstat_t *);
275
		       struct xfs_bstat *);
276
static rv_t dump_file_reg(drive_t *drivep,
276
static rv_t dump_file_reg(drive_t *drivep,
277
			   context_t *contextp,
277
			   context_t *contextp,
278
			   content_inode_hdr_t *scwhdrp,
278
			   content_inode_hdr_t *scwhdrp,
279
			   jdm_fshandle_t *,
279
			   jdm_fshandle_t *,
280
			   xfs_bstat_t *,
280
			   struct xfs_bstat *,
281
			   bool_t *);
281
			   bool_t *);
282
static rv_t dump_file_spec(drive_t *drivep,
282
static rv_t dump_file_spec(drive_t *drivep,
283
			    context_t *contextp,
283
			    context_t *contextp,
284
			    jdm_fshandle_t *,
284
			    jdm_fshandle_t *,
285
			    xfs_bstat_t *);
285
			    struct xfs_bstat *);
286
static rv_t dump_filehdr(drive_t *drivep,
286
static rv_t dump_filehdr(drive_t *drivep,
287
			  context_t *contextp,
287
			  context_t *contextp,
288
			  xfs_bstat_t *,
288
			  struct xfs_bstat *,
289
			  off64_t,
289
			  off64_t,
290
			  int);
290
			  int);
291
static rv_t dump_extenthdr(drive_t *drivep,
291
static rv_t dump_extenthdr(drive_t *drivep,
Lines 296-313 static rv_t dump_extenthdr(drive_t *drivep, Link Here
296
			    off64_t);
296
			    off64_t);
297
static rv_t dump_dirent(drive_t *drivep,
297
static rv_t dump_dirent(drive_t *drivep,
298
			 context_t *contextp,
298
			 context_t *contextp,
299
			 xfs_bstat_t *,
299
			 struct xfs_bstat *,
300
			 xfs_ino_t,
300
			 xfs_ino_t,
301
			 gen_t,
301
			 gen_t,
302
			 char *,
302
			 char *,
303
			 size_t);
303
			 size_t);
304
static rv_t init_extent_group_context(jdm_fshandle_t *,
304
static rv_t init_extent_group_context(jdm_fshandle_t *,
305
				       xfs_bstat_t *,
305
				       struct xfs_bstat *,
306
				       extent_group_context_t *);
306
				       extent_group_context_t *);
307
static void cleanup_extent_group_context(extent_group_context_t *);
307
static void cleanup_extent_group_context(extent_group_context_t *);
308
static rv_t dump_extent_group(drive_t *drivep,
308
static rv_t dump_extent_group(drive_t *drivep,
309
			       context_t *contextp,
309
			       context_t *contextp,
310
			       xfs_bstat_t *,
310
			       struct xfs_bstat *,
311
			       extent_group_context_t *,
311
			       extent_group_context_t *,
312
			       off64_t,
312
			       off64_t,
313
			       off64_t,
313
			       off64_t,
Lines 352-366 static bool_t check_complete_flags(void); Link Here
352
static rv_t dump_extattrs(drive_t *drivep,
352
static rv_t dump_extattrs(drive_t *drivep,
353
			   context_t *contextp,
353
			   context_t *contextp,
354
	       		   jdm_fshandle_t *fshandlep,
354
	       		   jdm_fshandle_t *fshandlep,
355
			   xfs_bstat_t *statp);
355
			   struct xfs_bstat *statp);
356
static rv_t dump_extattr_list(drive_t *drivep,
356
static rv_t dump_extattr_list(drive_t *drivep,
357
			       context_t *contextp,
357
			       context_t *contextp,
358
	       		       jdm_fshandle_t *fshandlep,
358
	       		       jdm_fshandle_t *fshandlep,
359
			       xfs_bstat_t *statp,
359
			       struct xfs_bstat *statp,
360
			       attrlist_t *listp,
360
			       attrlist_t *listp,
361
			       int flag,
361
			       int flag,
362
			       bool_t *abortprp);
362
			       bool_t *abortprp);
363
static char *dump_extattr_buildrecord(xfs_bstat_t *statp,
363
static char *dump_extattr_buildrecord(struct xfs_bstat *statp,
364
				       char *dumpbufp,
364
				       char *dumpbufp,
365
				       char *dumpbufendp,
365
				       char *dumpbufendp,
366
				       char *namesrcp,
366
				       char *namesrcp,
Lines 369-375 static char *dump_extattr_buildrecord(xfs_bstat_t *statp, Link Here
369
				       char **valuepp);
369
				       char **valuepp);
370
static rv_t dump_extattrhdr(drive_t *drivep,
370
static rv_t dump_extattrhdr(drive_t *drivep,
371
			     context_t *contextp,
371
			     context_t *contextp,
372
			     xfs_bstat_t *statp,
372
			     struct xfs_bstat *statp,
373
			     size_t recsz,
373
			     size_t recsz,
374
			     size_t valoff,
374
			     size_t valoff,
375
			     ix_t flags,
375
			     ix_t flags,
Lines 432-438 static jdm_fshandle_t *sc_fshandlep = 0; Link Here
432
static int sc_fsfd = -1;
432
static int sc_fsfd = -1;
433
	/* open file descriptor for root directory
433
	/* open file descriptor for root directory
434
	 */
434
	 */
435
static xfs_bstat_t *sc_rootxfsstatp = 0;
435
static struct xfs_bstat *sc_rootxfsstatp = 0;
436
	/* pointer to loaded bulkstat for root directory
436
	/* pointer to loaded bulkstat for root directory
437
	 */
437
	 */
438
static startpt_t *sc_startptp = 0;
438
static startpt_t *sc_startptp = 0;
Lines 1382-1388 content_init(int argc, Link Here
1382
	}
1382
	}
1383
1383
1384
	/* figure out the ino for the root directory of the fs
1384
	/* figure out the ino for the root directory of the fs
1385
	 * and get its xfs_bstat_t for inomap_build().  This could
1385
	 * and get its struct xfs_bstat for inomap_build().  This could
1386
	 * be a bind mount; don't ask for the mount point inode,
1386
	 * be a bind mount; don't ask for the mount point inode,
1387
	 * find the actual lowest inode number in the filesystem.
1387
	 * find the actual lowest inode number in the filesystem.
1388
	 */
1388
	 */
Lines 1390-1396 content_init(int argc, Link Here
1390
		stat64_t rootstat;
1390
		stat64_t rootstat;
1391
		xfs_ino_t lastino = 0;
1391
		xfs_ino_t lastino = 0;
1392
		int ocount = 0;
1392
		int ocount = 0;
1393
		xfs_fsop_bulkreq_t bulkreq;
1393
		struct xfs_fsop_bulkreq bulkreq;
1394
1394
1395
		/* Get the inode of the mount point */
1395
		/* Get the inode of the mount point */
1396
		rval = fstat64(sc_fsfd, &rootstat);
1396
		rval = fstat64(sc_fsfd, &rootstat);
Lines 1401-1407 content_init(int argc, Link Here
1401
			return BOOL_FALSE;
1401
			return BOOL_FALSE;
1402
		}
1402
		}
1403
		sc_rootxfsstatp =
1403
		sc_rootxfsstatp =
1404
			(xfs_bstat_t *)calloc(1, sizeof(xfs_bstat_t));
1404
			(struct xfs_bstat *)calloc(1, sizeof(struct xfs_bstat));
1405
		assert(sc_rootxfsstatp);
1405
		assert(sc_rootxfsstatp);
1406
1406
1407
		/* Get the first valid (i.e. root) inode in this fs */
1407
		/* Get the first valid (i.e. root) inode in this fs */
Lines 2119-2125 content_stream_dump(ix_t strmix) Link Here
2119
	bool_t empty_mediafile;
2119
	bool_t empty_mediafile;
2120
	time_t elapsed;
2120
	time_t elapsed;
2121
	inv_stmtoken_t inv_stmt;
2121
	inv_stmtoken_t inv_stmt;
2122
	xfs_bstat_t *bstatbufp;
2122
	struct xfs_bstat *bstatbufp;
2123
	const size_t bstatbuflen = BSTATBUFLEN;
2123
	const size_t bstatbuflen = BSTATBUFLEN;
2124
	int rval;
2124
	int rval;
2125
	rv_t rv;
2125
	rv_t rv;
Lines 2130-2137 content_stream_dump(ix_t strmix) Link Here
2130
2130
2131
	/* allocate a buffer for use by bstat_iter
2131
	/* allocate a buffer for use by bstat_iter
2132
	 */
2132
	 */
2133
	bstatbufp = (xfs_bstat_t *)calloc(bstatbuflen,
2133
	bstatbufp = (struct xfs_bstat *)calloc(bstatbuflen,
2134
					     sizeof(xfs_bstat_t));
2134
					     sizeof(struct xfs_bstat));
2135
	assert(bstatbufp);
2135
	assert(bstatbufp);
2136
2136
2137
	/* allocate an inomap context */
2137
	/* allocate an inomap context */
Lines 2806-2818 update_cc_Media_useterminatorpr(drive_t *drivep, context_t *contextp) Link Here
2806
2806
2807
static rv_t
2807
static rv_t
2808
dump_dirs(ix_t strmix,
2808
dump_dirs(ix_t strmix,
2809
	   xfs_bstat_t *bstatbufp,
2809
	   struct xfs_bstat *bstatbufp,
2810
	   size_t bstatbuflen,
2810
	   size_t bstatbuflen,
2811
	   void *inomap_contextp)
2811
	   void *inomap_contextp)
2812
{
2812
{
2813
	xfs_ino_t lastino;
2813
	xfs_ino_t lastino;
2814
	size_t bulkstatcallcnt;
2814
	size_t bulkstatcallcnt;
2815
        xfs_fsop_bulkreq_t bulkreq;
2815
        struct xfs_fsop_bulkreq bulkreq;
2816
2816
2817
	inomap_reset_context(inomap_contextp);
2817
	inomap_reset_context(inomap_contextp);
2818
2818
Lines 2820-2827 dump_dirs(ix_t strmix, Link Here
2820
	 */
2820
	 */
2821
	lastino = 0;
2821
	lastino = 0;
2822
	for (bulkstatcallcnt = 0 ; ; bulkstatcallcnt++) {
2822
	for (bulkstatcallcnt = 0 ; ; bulkstatcallcnt++) {
2823
		xfs_bstat_t *p;
2823
		struct xfs_bstat *p;
2824
		xfs_bstat_t *endp;
2824
		struct xfs_bstat *endp;
2825
		__s32 buflenout;
2825
		__s32 buflenout;
2826
		int rval;
2826
		int rval;
2827
2827
Lines 2928-2934 static rv_t Link Here
2928
dump_dir(ix_t strmix,
2928
dump_dir(ix_t strmix,
2929
	  jdm_fshandle_t *fshandlep,
2929
	  jdm_fshandle_t *fshandlep,
2930
	  int fsfd,
2930
	  int fsfd,
2931
	  xfs_bstat_t *statp)
2931
	  struct xfs_bstat *statp)
2932
{
2932
{
2933
	context_t *contextp = &sc_contextp[strmix];
2933
	context_t *contextp = &sc_contextp[strmix];
2934
	drive_t *drivep = drivepp[strmix];
2934
	drive_t *drivep = drivepp[strmix];
Lines 3110-3116 dump_dir(ix_t strmix, Link Here
3110
			 * if it's not there, we have to get it the slow way.
3110
			 * if it's not there, we have to get it the slow way.
3111
			 */
3111
			 */
3112
			if (inomap_get_gen(NULL, p->d_ino, &gen)) {
3112
			if (inomap_get_gen(NULL, p->d_ino, &gen)) {
3113
				xfs_bstat_t statbuf;
3113
				struct xfs_bstat statbuf;
3114
				int scrval;
3114
				int scrval;
3115
3115
3116
				scrval = bigstat_one(fsfd,
3116
				scrval = bigstat_one(fsfd,
Lines 3169-3175 static rv_t Link Here
3169
dump_extattrs(drive_t *drivep,
3169
dump_extattrs(drive_t *drivep,
3170
	       context_t *contextp,
3170
	       context_t *contextp,
3171
	       jdm_fshandle_t *fshandlep,
3171
	       jdm_fshandle_t *fshandlep,
3172
	       xfs_bstat_t *statp)
3172
	       struct xfs_bstat *statp)
3173
{
3173
{
3174
	ix_t pass;
3174
	ix_t pass;
3175
	int flag;
3175
	int flag;
Lines 3269-3275 static rv_t Link Here
3269
dump_extattr_list(drive_t *drivep,
3269
dump_extattr_list(drive_t *drivep,
3270
		   context_t *contextp,
3270
		   context_t *contextp,
3271
		   jdm_fshandle_t *fshandlep,
3271
		   jdm_fshandle_t *fshandlep,
3272
		   xfs_bstat_t *statp,
3272
		   struct xfs_bstat *statp,
3273
		   attrlist_t *listp,
3273
		   attrlist_t *listp,
3274
		   int flag,
3274
		   int flag,
3275
		   bool_t *abortprp)
3275
		   bool_t *abortprp)
Lines 3572-3578 dump_extattr_list(drive_t *drivep, Link Here
3572
}
3572
}
3573
3573
3574
static char *
3574
static char *
3575
dump_extattr_buildrecord(xfs_bstat_t *statp,
3575
dump_extattr_buildrecord(struct xfs_bstat *statp,
3576
			  char *dumpbufp,
3576
			  char *dumpbufp,
3577
			  char *dumpbufendp,
3577
			  char *dumpbufendp,
3578
			  char *namesrcp,
3578
			  char *namesrcp,
Lines 3655-3661 dump_extattr_buildrecord(xfs_bstat_t *statp, Link Here
3655
static rv_t
3655
static rv_t
3656
dump_extattrhdr(drive_t *drivep,
3656
dump_extattrhdr(drive_t *drivep,
3657
		 context_t *contextp,
3657
		 context_t *contextp,
3658
		 xfs_bstat_t *statp,
3658
		 struct xfs_bstat *statp,
3659
		 size_t recsz,
3659
		 size_t recsz,
3660
		 size_t valoff,
3660
		 size_t valoff,
3661
		 ix_t flags,
3661
		 ix_t flags,
Lines 3712-3718 static rv_t Link Here
3712
dump_file(void *arg1,
3712
dump_file(void *arg1,
3713
	   jdm_fshandle_t *fshandlep,
3713
	   jdm_fshandle_t *fshandlep,
3714
	   int fsfd,
3714
	   int fsfd,
3715
	   xfs_bstat_t *statp)
3715
	   struct xfs_bstat *statp)
3716
{
3716
{
3717
	ix_t strmix = (ix_t)arg1;
3717
	ix_t strmix = (ix_t)arg1;
3718
	context_t *contextp = &sc_contextp[strmix];
3718
	context_t *contextp = &sc_contextp[strmix];
Lines 3942-3948 dump_file_reg(drive_t *drivep, Link Here
3942
	       context_t *contextp,
3942
	       context_t *contextp,
3943
	       content_inode_hdr_t *scwhdrp,
3943
	       content_inode_hdr_t *scwhdrp,
3944
	       jdm_fshandle_t *fshandlep,
3944
	       jdm_fshandle_t *fshandlep,
3945
	       xfs_bstat_t *statp,
3945
	       struct xfs_bstat *statp,
3946
	       bool_t *file_skippedp)
3946
	       bool_t *file_skippedp)
3947
{
3947
{
3948
	startpt_t *startptp = &scwhdrp->cih_startpt;
3948
	startpt_t *startptp = &scwhdrp->cih_startpt;
Lines 4163-4169 static rv_t Link Here
4163
dump_file_spec(drive_t *drivep,
4163
dump_file_spec(drive_t *drivep,
4164
		context_t *contextp,
4164
		context_t *contextp,
4165
		jdm_fshandle_t *fshandlep,
4165
		jdm_fshandle_t *fshandlep,
4166
		xfs_bstat_t *statp)
4166
		struct xfs_bstat *statp)
4167
{
4167
{
4168
	int rval;
4168
	int rval;
4169
	rv_t rv;
4169
	rv_t rv;
Lines 4277-4283 dump_file_spec(drive_t *drivep, Link Here
4277
 */
4277
 */
4278
static rv_t
4278
static rv_t
4279
init_extent_group_context(jdm_fshandle_t *fshandlep,
4279
init_extent_group_context(jdm_fshandle_t *fshandlep,
4280
			   xfs_bstat_t *statp,
4280
			   struct xfs_bstat *statp,
4281
			   extent_group_context_t *gcp)
4281
			   extent_group_context_t *gcp)
4282
{
4282
{
4283
	bool_t isrealtime;
4283
	bool_t isrealtime;
Lines 4340-4346 cleanup_extent_group_context(extent_group_context_t *gcp) Link Here
4340
static rv_t
4340
static rv_t
4341
dump_extent_group(drive_t *drivep,
4341
dump_extent_group(drive_t *drivep,
4342
		   context_t *contextp,
4342
		   context_t *contextp,
4343
		   xfs_bstat_t *statp,
4343
		   struct xfs_bstat *statp,
4344
		   extent_group_context_t *gcp,
4344
		   extent_group_context_t *gcp,
4345
		   off64_t maxcnt,
4345
		   off64_t maxcnt,
4346
		   off64_t stopoffset,
4346
		   off64_t stopoffset,
Lines 4932-4938 dump_extent_group(drive_t *drivep, Link Here
4932
4932
4933
/* Note: assumes the pad fields in dst have been zeroed. */
4933
/* Note: assumes the pad fields in dst have been zeroed. */
4934
static void
4934
static void
4935
copy_xfs_bstat(bstat_t *dst, xfs_bstat_t *src)
4935
copy_xfs_bstat(bstat_t *dst, struct xfs_bstat *src)
4936
{
4936
{
4937
	dst->bs_ino = src->bs_ino;
4937
	dst->bs_ino = src->bs_ino;
4938
	dst->bs_mode = src->bs_mode;
4938
	dst->bs_mode = src->bs_mode;
Lines 4963-4969 copy_xfs_bstat(bstat_t *dst, xfs_bstat_t *src) Link Here
4963
static rv_t
4963
static rv_t
4964
dump_filehdr(drive_t *drivep,
4964
dump_filehdr(drive_t *drivep,
4965
	      context_t *contextp,
4965
	      context_t *contextp,
4966
	      xfs_bstat_t *statp,
4966
	      struct xfs_bstat *statp,
4967
	      off64_t offset,
4967
	      off64_t offset,
4968
	      int flags)
4968
	      int flags)
4969
{
4969
{
Lines 5086-5092 dump_extenthdr(drive_t *drivep, Link Here
5086
static rv_t
5086
static rv_t
5087
dump_dirent(drive_t *drivep,
5087
dump_dirent(drive_t *drivep,
5088
	     context_t *contextp,
5088
	     context_t *contextp,
5089
	     xfs_bstat_t *statp,
5089
	     struct xfs_bstat *statp,
5090
	     xfs_ino_t ino,
5090
	     xfs_ino_t ino,
5091
	     gen_t gen,
5091
	     gen_t gen,
5092
	     char *name,
5092
	     char *name,
(-)a/dump/inomap.c (-24 / +24 lines)
Lines 79-87 static int cb_context(bool_t last, Link Here
79
			    bool_t,
79
			    bool_t,
80
			    bool_t *);
80
			    bool_t *);
81
static void cb_context_free(void);
81
static void cb_context_free(void);
82
static int cb_count_inogrp(void *, int, xfs_inogrp_t *);
82
static int cb_count_inogrp(void *, int, struct xfs_inogrp *);
83
static int cb_add_inogrp(void *, int, xfs_inogrp_t *);
83
static int cb_add_inogrp(void *, int, struct xfs_inogrp *);
84
static int cb_add(void *, jdm_fshandle_t *, int, xfs_bstat_t *);
84
static int cb_add(void *, jdm_fshandle_t *, int, struct xfs_bstat *);
85
static bool_t cb_inoinresumerange(xfs_ino_t);
85
static bool_t cb_inoinresumerange(xfs_ino_t);
86
static bool_t cb_inoresumed(xfs_ino_t);
86
static bool_t cb_inoresumed(xfs_ino_t);
87
static void cb_accuminit_sz(void);
87
static void cb_accuminit_sz(void);
Lines 89-102 static void cb_spinit(void); Link Here
89
static int cb_startpt(void *,
89
static int cb_startpt(void *,
90
			    jdm_fshandle_t *,
90
			    jdm_fshandle_t *,
91
			    int,
91
			    int,
92
			    xfs_bstat_t *);
92
			    struct xfs_bstat *);
93
static int supprt_prune(void *,
93
static int supprt_prune(void *,
94
			      jdm_fshandle_t *,
94
			      jdm_fshandle_t *,
95
			      int,
95
			      int,
96
			      xfs_bstat_t *,
96
			      struct xfs_bstat *,
97
			      char *);
97
			      char *);
98
static off64_t quantity2offset(jdm_fshandle_t *, xfs_bstat_t *, off64_t);
98
static off64_t quantity2offset(jdm_fshandle_t *, struct xfs_bstat *, off64_t);
99
static off64_t estimate_dump_space(xfs_bstat_t *);
99
static off64_t estimate_dump_space(struct xfs_bstat *);
100
100
101
/* inomap primitives
101
/* inomap primitives
102
 */
102
 */
Lines 110-125 static void inomap_set_gen(void *, xfs_ino_t, gen_t); Link Here
110
static int subtree_descend_cb(void *,
110
static int subtree_descend_cb(void *,
111
				    jdm_fshandle_t *,
111
				    jdm_fshandle_t *,
112
				    int fsfd,
112
				    int fsfd,
113
				    xfs_bstat_t *,
113
				    struct xfs_bstat *,
114
				    char *);
114
				    char *);
115
static int subtreelist_parse_cb(void *,
115
static int subtreelist_parse_cb(void *,
116
				      jdm_fshandle_t *,
116
				      jdm_fshandle_t *,
117
				      int fsfd,
117
				      int fsfd,
118
				      xfs_bstat_t *,
118
				      struct xfs_bstat *,
119
				      char *);
119
				      char *);
120
static int subtreelist_parse(jdm_fshandle_t *,
120
static int subtreelist_parse(jdm_fshandle_t *,
121
				   int,
121
				   int,
122
				   xfs_bstat_t *,
122
				   struct xfs_bstat *,
123
				   char *[],
123
				   char *[],
124
				   ix_t);
124
				   ix_t);
125
125
Lines 144-150 static uint64_t inomap_exclude_skipattr = 0; Link Here
144
bool_t
144
bool_t
145
inomap_build(jdm_fshandle_t *fshandlep,
145
inomap_build(jdm_fshandle_t *fshandlep,
146
	      int fsfd,
146
	      int fsfd,
147
	      xfs_bstat_t *rootstatp,
147
	      struct xfs_bstat *rootstatp,
148
	      bool_t last,
148
	      bool_t last,
149
	      time32_t lasttime,
149
	      time32_t lasttime,
150
	      bool_t resume,
150
	      bool_t resume,
Lines 161-167 inomap_build(jdm_fshandle_t *fshandlep, Link Here
161
	      size64_t statcnt,
161
	      size64_t statcnt,
162
	      size64_t *statdonep)
162
	      size64_t *statdonep)
163
{
163
{
164
	xfs_bstat_t *bstatbufp;
164
	struct xfs_bstat *bstatbufp;
165
	size_t bstatbuflen;
165
	size_t bstatbuflen;
166
	bool_t pruneneeded = BOOL_FALSE;
166
	bool_t pruneneeded = BOOL_FALSE;
167
	int igrpcnt = 0;
167
	int igrpcnt = 0;
Lines 185-194 inomap_build(jdm_fshandle_t *fshandlep, Link Here
185
	/* allocate a bulkstat buf
185
	/* allocate a bulkstat buf
186
	 */
186
	 */
187
	bstatbuflen = BSTATBUFLEN;
187
	bstatbuflen = BSTATBUFLEN;
188
	bstatbufp = (xfs_bstat_t *)memalign(pgsz,
188
	bstatbufp = (struct xfs_bstat *)memalign(pgsz,
189
					       bstatbuflen
189
					       bstatbuflen
190
					       *
190
					       *
191
					       sizeof(xfs_bstat_t));
191
					       sizeof(struct xfs_bstat));
192
	assert(bstatbufp);
192
	assert(bstatbufp);
193
193
194
	/* count the number of inode groups, which will serve as a
194
	/* count the number of inode groups, which will serve as a
Lines 488-494 cb_context_free(void) Link Here
488
}
488
}
489
489
490
static int
490
static int
491
cb_count_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
491
cb_count_inogrp(void *arg1, int fsfd, struct xfs_inogrp *inogrp)
492
{
492
{
493
	int *count = (int *)arg1;
493
	int *count = (int *)arg1;
494
	(*count)++;
494
	(*count)++;
Lines 505-511 static int Link Here
505
cb_add(void *arg1,
505
cb_add(void *arg1,
506
	jdm_fshandle_t *fshandlep,
506
	jdm_fshandle_t *fshandlep,
507
	int fsfd,
507
	int fsfd,
508
	xfs_bstat_t *statp)
508
	struct xfs_bstat *statp)
509
{
509
{
510
	register time32_t mtime = statp->bs_mtime.tv_sec;
510
	register time32_t mtime = statp->bs_mtime.tv_sec;
511
	register time32_t ctime = statp->bs_ctime.tv_sec;
511
	register time32_t ctime = statp->bs_ctime.tv_sec;
Lines 691-697 static bool_t /* false, used as diriter callback */ Link Here
691
supprt_prune(void *arg1,	/* ancestors marked as changed? */
691
supprt_prune(void *arg1,	/* ancestors marked as changed? */
692
	      jdm_fshandle_t *fshandlep,
692
	      jdm_fshandle_t *fshandlep,
693
	      int fsfd,
693
	      int fsfd,
694
	      xfs_bstat_t *statp,
694
	      struct xfs_bstat *statp,
695
	      char *name)
695
	      char *name)
696
{
696
{
697
	static bool_t cbrval = BOOL_FALSE;
697
	static bool_t cbrval = BOOL_FALSE;
Lines 812-818 static int Link Here
812
cb_startpt(void *arg1,
812
cb_startpt(void *arg1,
813
	    jdm_fshandle_t *fshandlep,
813
	    jdm_fshandle_t *fshandlep,
814
	    int fsfd,
814
	    int fsfd,
815
	    xfs_bstat_t *statp)
815
	    struct xfs_bstat *statp)
816
{
816
{
817
	register int state;
817
	register int state;
818
818
Lines 1116-1122 inomap_lastseg(int hnkoff) Link Here
1116
 * order. adds a new segment to the inomap and ino-to-gen map.
1116
 * order. adds a new segment to the inomap and ino-to-gen map.
1117
 */
1117
 */
1118
static int
1118
static int
1119
cb_add_inogrp(void *arg1, int fsfd, xfs_inogrp_t *inogrp)
1119
cb_add_inogrp(void *arg1, int fsfd, struct xfs_inogrp *inogrp)
1120
{
1120
{
1121
	hnk_t *hunk;
1121
	hnk_t *hunk;
1122
	seg_t *segp;
1122
	seg_t *segp;
Lines 1472-1478 inomap_dump(drive_t *drivep) Link Here
1472
static int
1472
static int
1473
subtreelist_parse(jdm_fshandle_t *fshandlep,
1473
subtreelist_parse(jdm_fshandle_t *fshandlep,
1474
		   int fsfd,
1474
		   int fsfd,
1475
		   xfs_bstat_t *rootstatp,
1475
		   struct xfs_bstat *rootstatp,
1476
		   char *subtreebuf[],
1476
		   char *subtreebuf[],
1477
		   ix_t subtreecnt)
1477
		   ix_t subtreecnt)
1478
{
1478
{
Lines 1513-1519 static int Link Here
1513
subtreelist_parse_cb(void *arg1,
1513
subtreelist_parse_cb(void *arg1,
1514
		      jdm_fshandle_t *fshandlep,
1514
		      jdm_fshandle_t *fshandlep,
1515
		      int fsfd,
1515
		      int fsfd,
1516
		      xfs_bstat_t *statp,
1516
		      struct xfs_bstat *statp,
1517
		      char *name)
1517
		      char *name)
1518
{
1518
{
1519
	int cbrval = 0;
1519
	int cbrval = 0;
Lines 1596-1602 static int Link Here
1596
subtree_descend_cb(void *arg1,
1596
subtree_descend_cb(void *arg1,
1597
		    jdm_fshandle_t *fshandlep,
1597
		    jdm_fshandle_t *fshandlep,
1598
		    int fsfd,
1598
		    int fsfd,
1599
		    xfs_bstat_t *statp,
1599
		    struct xfs_bstat *statp,
1600
		    char *name)
1600
		    char *name)
1601
{
1601
{
1602
	int cbrval = 0;
1602
	int cbrval = 0;
Lines 1624-1630 subtree_descend_cb(void *arg1, Link Here
1624
#define BMAP_LEN	512
1624
#define BMAP_LEN	512
1625
1625
1626
static off64_t
1626
static off64_t
1627
quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty)
1627
quantity2offset(jdm_fshandle_t *fshandlep, struct xfs_bstat *statp, off64_t qty)
1628
{
1628
{
1629
	int fd;
1629
	int fd;
1630
	getbmapx_t bmap[BMAP_LEN];
1630
	getbmapx_t bmap[BMAP_LEN];
Lines 1699-1705 quantity2offset(jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty) Link Here
1699
1699
1700
1700
1701
static off64_t
1701
static off64_t
1702
estimate_dump_space(xfs_bstat_t *statp)
1702
estimate_dump_space(struct xfs_bstat *statp)
1703
{
1703
{
1704
	switch (statp->bs_mode & S_IFMT) {
1704
	switch (statp->bs_mode & S_IFMT) {
1705
	case S_IFREG:
1705
	case S_IFREG:

Return to bug 693296