struct ViceInodeInfo *ip, int nInodes,
struct VolumeSummary *volSummary, int check)
{
- VolumeId volumeNumber;
char buf[SIZEOF_LARGEDISKVNODE];
struct VnodeDiskObject *vnode = (struct VnodeDiskObject *)buf;
int err = 0;
IHandle_t *handle;
FdHandle_t *fdP;
- volumeNumber = volSummary->header.id;
IH_INIT(handle, salvinfo->fileSysDevice, volSummary->header.parent, ino);
fdP = IH_OPEN(handle);
assert(fdP != NULL);
if (vnode->type != vNull) {
int vnodeChanged = 0;
int vnodeNumber = bitNumberToVnodeNumber(vnodeIndex, class);
- /* Log programs that belong to root (potentially suid root);
- * don't bother for read-only or backup volumes */
-#ifdef notdef /* This is done elsewhere */
- if (ShowRootFiles && RW && vnode->owner == 0 && vnodeNumber != 1)
- Log("OWNER IS ROOT %s %u dir %u vnode %u author %u owner %u mode %o\n", salvinfo->VolInfo.name, volumeNumber, vnode->parent, vnodeNumber, vnode->author, vnode->owner, vnode->modeBits);
-#endif
if (VNDISK_GET_INO(vnode) == 0) {
if (RW) {
/* Log("### DEBUG ### Deleted Vnode with 0 inode (vnode %d)\n", vnodeNumber); */
/* have we read in the header successfully? */
int read_header = 0;
+#ifdef AFS_DEMAND_ATTACH_FS
/* should we FreeVolume(vp) instead of VCheckFree(vp) in the error
* cleanup? */
int forcefree = 0;
-#ifdef AFS_DEMAND_ATTACH_FS
/* in the case of an error, to what state should the volume be
* transitioned? */
VolState error_state = VOL_STATE_ERROR;
VRequestSalvage_r(ec, vp, SALVSYNC_ERROR, VOL_SALVAGE_INVALIDATE_HEADER);
VChangeState_r(vp, VOL_STATE_ERROR);
vp->nUsers = 0;
+ forcefree = 1;
#endif /* AFS_DEMAND_ATTACH_FS */
Log("VAttachVolume: volume %s is junk; it should be destroyed at next salvage\n", path);
*ec = VNOVOL;
- forcefree = 1;
goto error;
}
void
VDetachVolume_r(Error * ec, Volume * vp)
{
+#ifdef FSSYNC_BUILD_CLIENT
VolumeId volume;
struct DiskPartition64 *tpartp;
int notifyServer = 0;
int useDone = FSYNC_VOL_ON;
- *ec = 0; /* always "succeeds" */
if (VCanUseFSSYNC()) {
notifyServer = vp->needsPutBack;
if (V_destroyMe(vp) == DESTROY_ME)
}
tpartp = vp->partition;
volume = V_id(vp);
+#endif /* FSSYNC_BUILD_CLIENT */
+
+ *ec = 0; /* always "succeeds" */
DeleteVolumeFromHashTable(vp);
vp->shuttingDown = 1;
#ifdef AFS_DEMAND_ATTACH_FS