|
Lines 477-485
struct pers {
Link Here
|
| 477 |
/* how many pages following the header page are reserved |
477 |
/* how many pages following the header page are reserved |
| 478 |
* for the subtree descriptors |
478 |
* for the subtree descriptors |
| 479 |
*/ |
479 |
*/ |
| 480 |
bool_t restoredmpr; |
|
|
| 481 |
/* restore DMAPI event settings |
| 482 |
*/ |
| 483 |
bool_t restoreextattrpr; |
480 |
bool_t restoreextattrpr; |
| 484 |
/* restore extended attributes |
481 |
/* restore extended attributes |
| 485 |
*/ |
482 |
*/ |
|
Lines 858-864
static void partial_reg(ix_t d_index, xfs_ino_t ino, off64_t fsize,
Link Here
|
| 858 |
off64_t offset, off64_t sz); |
855 |
off64_t offset, off64_t sz); |
| 859 |
static bool_t partial_check (xfs_ino_t ino, off64_t fsize); |
856 |
static bool_t partial_check (xfs_ino_t ino, off64_t fsize); |
| 860 |
static bool_t partial_check2 (partial_rest_t *isptr, off64_t fsize); |
857 |
static bool_t partial_check2 (partial_rest_t *isptr, off64_t fsize); |
| 861 |
static int do_fssetdm_by_handle(char *path, fsdmidata_t *fdmp); |
|
|
| 862 |
static int quotafilecheck(char *type, char *dstdir, char *quotafile); |
858 |
static int quotafilecheck(char *type, char *dstdir, char *quotafile); |
| 863 |
|
859 |
|
| 864 |
/* definition of locally defined global variables ****************************/ |
860 |
/* definition of locally defined global variables ****************************/ |
|
Lines 894-900
content_init(int argc, char *argv[], size64_t vmsz)
Link Here
|
| 894 |
bool_t changepr;/* cmd line overwrite inhibit specification */ |
890 |
bool_t changepr;/* cmd line overwrite inhibit specification */ |
| 895 |
bool_t interpr; /* cmd line interactive mode requested */ |
891 |
bool_t interpr; /* cmd line interactive mode requested */ |
| 896 |
bool_t ownerpr; /* cmd line chown/chmod requested */ |
892 |
bool_t ownerpr; /* cmd line chown/chmod requested */ |
| 897 |
bool_t restoredmpr; /* cmd line restore dm api attrs specification */ |
|
|
| 898 |
bool_t restoreextattrpr; /* cmd line restore extended attr spec */ |
893 |
bool_t restoreextattrpr; /* cmd line restore extended attr spec */ |
| 899 |
bool_t sesscpltpr; /* force completion of prev interrupted session */ |
894 |
bool_t sesscpltpr; /* force completion of prev interrupted session */ |
| 900 |
ix_t stcnt; /* cmd line number of subtrees requested */ |
895 |
ix_t stcnt; /* cmd line number of subtrees requested */ |
|
Lines 956-962
content_init(int argc, char *argv[], size64_t vmsz)
Link Here
|
| 956 |
newerpr = BOOL_FALSE; |
951 |
newerpr = BOOL_FALSE; |
| 957 |
changepr = BOOL_FALSE; |
952 |
changepr = BOOL_FALSE; |
| 958 |
ownerpr = BOOL_FALSE; |
953 |
ownerpr = BOOL_FALSE; |
| 959 |
restoredmpr = BOOL_FALSE; |
|
|
| 960 |
restoreextattrpr = BOOL_TRUE; |
954 |
restoreextattrpr = BOOL_TRUE; |
| 961 |
sesscpltpr = BOOL_FALSE; |
955 |
sesscpltpr = BOOL_FALSE; |
| 962 |
stcnt = 0; |
956 |
stcnt = 0; |
|
Lines 1162-1169
content_init(int argc, char *argv[], size64_t vmsz)
Link Here
|
| 1162 |
tranp->t_noinvupdatepr = BOOL_TRUE; |
1156 |
tranp->t_noinvupdatepr = BOOL_TRUE; |
| 1163 |
break; |
1157 |
break; |
| 1164 |
case GETOPT_SETDM: |
1158 |
case GETOPT_SETDM: |
| 1165 |
restoredmpr = BOOL_TRUE; |
1159 |
mlog(MLOG_NORMAL | MLOG_ERROR, _( |
| 1166 |
break; |
1160 |
"-%c option no longer supported\n"), |
|
|
1161 |
GETOPT_SETDM); |
| 1162 |
usage(); |
| 1163 |
return BOOL_FALSE; |
| 1167 |
case GETOPT_ALERTPROG: |
1164 |
case GETOPT_ALERTPROG: |
| 1168 |
if (!optarg || optarg[0] == '-') { |
1165 |
if (!optarg || optarg[0] == '-') { |
| 1169 |
mlog(MLOG_NORMAL | MLOG_ERROR, _( |
1166 |
mlog(MLOG_NORMAL | MLOG_ERROR, _( |
|
Lines 1574-1585
content_init(int argc, char *argv[], size64_t vmsz)
Link Here
|
| 1574 |
} |
1571 |
} |
| 1575 |
|
1572 |
|
| 1576 |
if (persp->a.valpr) { |
1573 |
if (persp->a.valpr) { |
| 1577 |
if (restoredmpr && persp->a.restoredmpr != restoredmpr) { |
|
|
| 1578 |
mlog(MLOG_NORMAL | MLOG_ERROR, _( |
| 1579 |
"-%c cannot reset flag from previous restore\n"), |
| 1580 |
GETOPT_SETDM); |
| 1581 |
return BOOL_FALSE; |
| 1582 |
} |
| 1583 |
if (!restoreextattrpr && |
1574 |
if (!restoreextattrpr && |
| 1584 |
persp->a.restoreextattrpr != restoreextattrpr) { |
1575 |
persp->a.restoreextattrpr != restoreextattrpr) { |
| 1585 |
mlog(MLOG_NORMAL | MLOG_ERROR, _( |
1576 |
mlog(MLOG_NORMAL | MLOG_ERROR, _( |
|
Lines 1734-1740
content_init(int argc, char *argv[], size64_t vmsz)
Link Here
|
| 1734 |
persp->a.newerpr = newerpr; |
1725 |
persp->a.newerpr = newerpr; |
| 1735 |
persp->a.newertime = newertime; |
1726 |
persp->a.newertime = newertime; |
| 1736 |
} |
1727 |
} |
| 1737 |
persp->a.restoredmpr = restoredmpr; |
|
|
| 1738 |
if (!persp->a.dstdirisxfspr) { |
1728 |
if (!persp->a.dstdirisxfspr) { |
| 1739 |
restoreextattrpr = BOOL_FALSE; |
1729 |
restoreextattrpr = BOOL_FALSE; |
| 1740 |
} |
1730 |
} |
|
Lines 2365-2371
content_stream_restore(ix_t thrdix)
Link Here
|
| 2365 |
scrhdrp->cih_inomap_nondircnt, |
2355 |
scrhdrp->cih_inomap_nondircnt, |
| 2366 |
tranp->t_vmsz, |
2356 |
tranp->t_vmsz, |
| 2367 |
fullpr, |
2357 |
fullpr, |
| 2368 |
persp->a.restoredmpr, |
|
|
| 2369 |
persp->a.dstdirisxfspr, |
2358 |
persp->a.dstdirisxfspr, |
| 2370 |
grhdrp->gh_version, |
2359 |
grhdrp->gh_version, |
| 2371 |
tranp->t_truncategenpr); |
2360 |
tranp->t_truncategenpr); |
|
Lines 7549-7560
restore_reg(drive_t *drivep,
Link Here
|
| 7549 |
} |
7538 |
} |
| 7550 |
} |
7539 |
} |
| 7551 |
|
7540 |
|
| 7552 |
if (persp->a.dstdirisxfspr && persp->a.restoredmpr) { |
|
|
| 7553 |
HsmBeginRestoreFile(bstatp, |
| 7554 |
*fdp, |
| 7555 |
&strctxp->sc_hsmflags); |
| 7556 |
} |
| 7557 |
|
| 7558 |
return BOOL_TRUE; |
7541 |
return BOOL_TRUE; |
| 7559 |
} |
7542 |
} |
| 7560 |
|
7543 |
|
|
Lines 7726-7751
restore_complete_reg(stream_context_t *strcxtp)
Link Here
|
| 7726 |
strerror(errno)); |
7709 |
strerror(errno)); |
| 7727 |
} |
7710 |
} |
| 7728 |
|
7711 |
|
| 7729 |
if (persp->a.dstdirisxfspr && persp->a.restoredmpr) { |
|
|
| 7730 |
fsdmidata_t fssetdm; |
| 7731 |
|
| 7732 |
/* Set the DMAPI Fields. */ |
| 7733 |
fssetdm.fsd_dmevmask = bstatp->bs_dmevmask; |
| 7734 |
fssetdm.fsd_padding = 0; |
| 7735 |
fssetdm.fsd_dmstate = bstatp->bs_dmstate; |
| 7736 |
|
| 7737 |
rval = ioctl(fd, XFS_IOC_FSSETDM, (void *)&fssetdm); |
| 7738 |
if (rval) { |
| 7739 |
mlog(MLOG_NORMAL | MLOG_WARNING, |
| 7740 |
_("attempt to set DMI attributes of %s " |
| 7741 |
"failed: %s\n"), |
| 7742 |
path, |
| 7743 |
strerror(errno)); |
| 7744 |
} |
| 7745 |
|
| 7746 |
HsmEndRestoreFile(path, fd, &strcxtp->sc_hsmflags); |
| 7747 |
} |
| 7748 |
|
| 7749 |
/* set any extended inode flags that couldn't be set |
7712 |
/* set any extended inode flags that couldn't be set |
| 7750 |
* prior to restoring the data. |
7713 |
* prior to restoring the data. |
| 7751 |
*/ |
7714 |
*/ |
|
Lines 8064-8080
restore_symlink(drive_t *drivep,
Link Here
|
| 8064 |
strerror(errno)); |
8027 |
strerror(errno)); |
| 8065 |
} |
8028 |
} |
| 8066 |
} |
8029 |
} |
| 8067 |
|
|
|
| 8068 |
if (persp->a.restoredmpr) { |
| 8069 |
fsdmidata_t fssetdm; |
| 8070 |
|
| 8071 |
/* Restore DMAPI fields. */ |
| 8072 |
|
| 8073 |
fssetdm.fsd_dmevmask = bstatp->bs_dmevmask; |
| 8074 |
fssetdm.fsd_padding = 0; |
| 8075 |
fssetdm.fsd_dmstate = bstatp->bs_dmstate; |
| 8076 |
rval = do_fssetdm_by_handle(path, &fssetdm); |
| 8077 |
} |
| 8078 |
} |
8030 |
} |
| 8079 |
|
8031 |
|
| 8080 |
return BOOL_TRUE; |
8032 |
return BOOL_TRUE; |
|
Lines 8777-8783
restore_extattr(drive_t *drivep,
Link Here
|
| 8777 |
} |
8729 |
} |
| 8778 |
assert(nread == (int)(recsz - EXTATTRHDR_SZ)); |
8730 |
assert(nread == (int)(recsz - EXTATTRHDR_SZ)); |
| 8779 |
|
8731 |
|
| 8780 |
if (!persp->a.restoreextattrpr && !persp->a.restoredmpr) { |
8732 |
if (!persp->a.restoreextattrpr) { |
| 8781 |
continue; |
8733 |
continue; |
| 8782 |
} |
8734 |
} |
| 8783 |
|
8735 |
|
|
Lines 8796-8814
restore_extattr(drive_t *drivep,
Link Here
|
| 8796 |
} |
8748 |
} |
| 8797 |
} else if (isfilerestored && path[0] != '\0') { |
8749 |
} else if (isfilerestored && path[0] != '\0') { |
| 8798 |
setextattr(path, ahdrp); |
8750 |
setextattr(path, ahdrp); |
| 8799 |
|
|
|
| 8800 |
if (persp->a.dstdirisxfspr && persp->a.restoredmpr) { |
| 8801 |
int flag = 0; |
| 8802 |
char *attrname = (char *)&ahdrp[1]; |
| 8803 |
if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_ROOT) |
| 8804 |
flag = ATTR_ROOT; |
| 8805 |
else if (ahdrp->ah_flags & EXTATTRHDR_FLAGS_SECURE) |
| 8806 |
flag = ATTR_SECURE; |
| 8807 |
|
| 8808 |
HsmRestoreAttribute(flag, |
| 8809 |
attrname, |
| 8810 |
&strctxp->sc_hsmflags); |
| 8811 |
} |
| 8812 |
} |
8751 |
} |
| 8813 |
} |
8752 |
} |
| 8814 |
/* NOTREACHED */ |
8753 |
/* NOTREACHED */ |
|
Lines 9709-9740
display_needed_objects(purp_t purp,
Link Here
|
| 9709 |
} |
9648 |
} |
| 9710 |
} |
9649 |
} |
| 9711 |
|
9650 |
|
| 9712 |
static int |
|
|
| 9713 |
do_fssetdm_by_handle( |
| 9714 |
char *path, |
| 9715 |
fsdmidata_t *fdmp) |
| 9716 |
{ |
| 9717 |
void *hanp; |
| 9718 |
size_t hlen=0; |
| 9719 |
int rc; |
| 9720 |
|
| 9721 |
if (path_to_handle(path, &hanp, &hlen)) { |
| 9722 |
mlog(MLOG_NORMAL | MLOG_WARNING, _( |
| 9723 |
"path_to_handle of %s failed:%s\n"), |
| 9724 |
path, strerror(errno)); |
| 9725 |
return -1; |
| 9726 |
} |
| 9727 |
|
| 9728 |
rc = fssetdm_by_handle(hanp, hlen, fdmp); |
| 9729 |
free_handle(hanp, hlen); |
| 9730 |
if (rc) { |
| 9731 |
mlog(MLOG_NORMAL | MLOG_WARNING, _( |
| 9732 |
"fssetdm_by_handle of %s failed %s\n"), |
| 9733 |
path, strerror(errno)); |
| 9734 |
} |
| 9735 |
return rc; |
| 9736 |
} |
| 9737 |
|
| 9738 |
static int |
9651 |
static int |
| 9739 |
quotafilecheck(char *type, char *dstdir, char *quotafile) |
9652 |
quotafilecheck(char *type, char *dstdir, char *quotafile) |
| 9740 |
{ |
9653 |
{ |