aix-namei-fileserver-support-20011031
authorHartmut Reuter <reuter@rzg.mpg.de>
Thu, 1 Nov 2001 03:58:36 +0000 (03:58 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 1 Nov 2001 03:58:36 +0000 (03:58 +0000)
necessary for namei support on aix

src/vol/partition.c
src/vol/vol-salvage.c

index cb16224..9c0b91d 100644 (file)
@@ -113,11 +113,7 @@ RCSID("$Header$");
 #include "ntops.h"
 #else
 #include "namei_ops.h"
-#if defined(AFS_SGI_ENV)
-#include <sys/dir.h>
-#else
 #include <dirent.h>
-#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);
index 80860aa..e675006 100644 (file)
@@ -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"