From 05186dbe192d54b5da38885eaee0eec4af164e14 Mon Sep 17 00:00:00 2001 From: Hartmut Reuter Date: Thu, 1 Nov 2001 03:58:36 +0000 Subject: [PATCH] aix-namei-fileserver-support-20011031 necessary for namei support on aix --- src/vol/partition.c | 18 ++++++++++++++---- src/vol/vol-salvage.c | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/vol/partition.c b/src/vol/partition.c index cb16224..9c0b91d 100644 --- a/src/vol/partition.c +++ b/src/vol/partition.c @@ -113,11 +113,7 @@ RCSID("$Header$"); #include "ntops.h" #else #include "namei_ops.h" -#if defined(AFS_SGI_ENV) -#include -#else #include -#endif /* AFS_SGI_ENV */ #endif /* AFS_NT40_ENV */ #endif /* AFS_NAMEI_ENV */ #include "vnode.h" @@ -500,6 +496,7 @@ int VAttachPartitions(void) continue; /* Ignore any "special" partitions */ #ifdef AFS_AIX42_ENV +#ifndef AFS_NAMEI_ENV { struct superblock fs; /* The Log statements are non-sequiters in the SalvageLog and don't @@ -517,6 +514,7 @@ int VAttachPartitions(void) } } #endif +#endif /* If we're going to always attach this partition, do it later. */ if (VIsAlwaysAttach(part)) @@ -1026,12 +1024,22 @@ void VLockPartition_r(char *name) unsigned int *globalMask; int globalMaskIndex; #endif /* defined(AFS_HPUX_ENV) */ +#ifdef AFS_NAMEI_ENV +#ifdef AFS_AIX42_ENV + char LockFileName[MAXPATHLEN + 1]; + + sprintf((char *)&LockFileName, "%s/AFSINODE_FSLock", name); + partitionName = (char *) &LockFileName; +#endif +#endif if (!dp) return; /* no partition, will fail later */ if (dp->lock_fd != -1) return; #if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) +#if !defined(AFS_AIX42_ENV) || !defined(AFS_NAMEI_ENV) partitionName = dp->devName; +#endif code = O_RDWR; #else partitionName = dp->name; @@ -1041,6 +1049,8 @@ void VLockPartition_r(char *name) for (retries=25; retries; retries--) { dp->lock_fd = open(partitionName, code); if (dp->lock_fd != -1) break; + if (errno == ENOENT) + code |= O_CREAT; pausing.tv_sec = 0; pausing.tv_usec = 500000; select(0, NULL, NULL, NULL, &pausing); diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 80860aa..e675006 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -836,6 +836,7 @@ struct stat *status; #endif #ifdef AFS_AIX42_ENV +#ifndef AFS_NAMEI_ENV /* We don't want to salvage big files filesystems, since we can't put volumes on * them. */ @@ -864,6 +865,7 @@ int CheckIfBigFilesFS(mountPoint, devName) return 0; } #endif +#endif #ifdef AFS_NT40_ENV #define HDSTR "\\Device\\Harddisk" -- 1.9.4