#endif
#include <rx/xdr.h>
#include <afs/afsint.h>
-#include <afs/afs_assert.h>
#if !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV)
#if defined(AFS_VFSINCL_ENV)
#include <sys/vnode.h>
#include "daemon_com.h"
#include "daemon_com_inline.h"
#include "fssync.h"
+#include "fssync_inline.h"
#include "volume_inline.h"
#include "salvsync.h"
#include "viceinode.h"
if (!VALID_INO(ino))
ino =
- IH_CREATE(NULL, salvinfo->fileSysDevice, salvinfo->fileSysPath, 0, isp->volumeId,
+ IH_CREATE(NULL, salvinfo->fileSysDevice, salvinfo->fileSysPath, 0, isp->RWvolumeId,
INODESPECIAL, VI_LINKTABLE, isp->RWvolumeId);
if (!VALID_INO(ino))
Abort
isp->volumeId, (Testing ? "it would have been " : ""),
path);
isp->volSummary = calloc(1, sizeof(struct VolumeSummary));
- isp->volSummary->fileName = ToString(headerName);
writefunc = VCreateVolumeDiskHeader;
} else {
} else {
snprintf(headerName, sizeof headerName, VFORMAT,
afs_printable_uint32_lu(isp->volumeId));
- isp->volSummary->fileName = ToString(headerName);
}
snprintf(path, sizeof path, "%s" OS_DIRSEP "%s",
salvinfo->fileSysPath, headerName);
Inode *ip;
afs_sfsize_t bytes;
struct VnodeEssence *vep;
- Inode readmeinode;
+ Inode readmeinode = 0;
time_t now = time(NULL);
if (!salvinfo->vnodeInfo[vLarge].vnodes && !salvinfo->vnodeInfo[vSmall].vnodes) {
afs_printable_uint32_lu(volumeId));
}
- code = FSYNC_VerifyCheckout(volumeId, salvinfo->fileSysPathName, FSYNC_VOL_OFF, FSYNC_SALVAGE);
+ code = FSYNC_VerifyCheckout(volumeId, salvinfo->fileSysPartition->name, FSYNC_VOL_OFF, FSYNC_SALVAGE);
if (code == SYNC_DENIED) {
/* need to retry checking out volumes */
return -1;
int
AskDAFS(void)
{
- afs_int32 code, i, ret = 0;
SYNC_response res;
+ afs_int32 code = 1, i;
/* we don't care if we race. the answer shouldn't change */
if (isDAFS != -1)
memset(&res, 0, sizeof(res));
- for (i = 0; i < 3; i++) {
- code = FSYNC_VolOp(1, NULL,
- FSYNC_VOL_QUERY_VOP, FSYNC_SALVAGE, &res);
-
- if (code == SYNC_OK) {
- ret = 1;
- break;
- } else if (code == SYNC_DENIED) {
- ret = 1;
- break;
- } else if (code == SYNC_BAD_COMMAND) {
- ret = 0;
- break;
- } else if (code == SYNC_FAILED) {
- if (res.hdr.reason == FSYNC_UNKNOWN_VOLID)
- ret = 1;
- else
- ret = 0;
- break;
- } else if (i < 2) {
- /* try it again */
- Log("AskDAFS: request to query fileserver failed; trying again...\n");
+ for (i = 0; code && i < 3; i++) {
+ code = FSYNC_VolOp(0, NULL, FSYNC_VOL_LISTVOLUMES, FSYNC_SALVAGE, &res);
+ if (code) {
+ Log("AskDAFS: FSYNC_VOL_LISTVOLUMES failed with code %ld reason "
+ "%ld (%s); trying again...\n", (long)code, (long)res.hdr.reason,
+ FSYNC_reason2string(res.hdr.reason));
FSYNC_clientFinis();
FSYNC_clientInit();
}
}
- isDAFS = ret;
- return ret;
+ if (code) {
+ Log("AskDAFS: could not determine DAFS-ness, assuming not DAFS\n");
+ res.hdr.flags = 0;
+ }
+
+ if ((res.hdr.flags & SYNC_FLAG_DAFS_EXTENSIONS)) {
+ isDAFS = 1;
+ } else {
+ isDAFS = 0;
+ }
+
+ return isDAFS;
}
static void