/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#endif
#include "lock.h"
-
+#if defined(AFS_DEMAND_ATTACH_FS) || defined(AFS_DEMAND_ATTACH_UTIL)
+# include <pthread.h>
+#endif
/* All Vice partitions on a server will have the following name prefix */
#define VICE_PARTITION_PREFIX "/vicep"
#define VICE_ALWAYSATTACH_FILE "AlwaysAttach"
#endif
+/* If a file by this name exists in a /vicepX directory, it means that
+ * this directory should NOT be used as an AFS partition.
+ */
+#define VICE_NEVERATTACH_FILE "NeverAttach"
+
/**
* abstraction for files used for file-locking.
*/
char *path; /**< path to the lock file */
int refcount; /**< how many locks we have on the file */
-#ifdef AFS_PTHREAD_ENV
+#if defined(AFS_PTHREAD_ENV) || defined(AFS_DEMAND_ATTACH_UTIL)
pthread_mutex_t mutex; /**< lock for the VLockFile struct */
-#endif /* AFS_PTHREAD_ENV */
+#endif /* AFS_PTHREAD_ENV || AFS_DEMAND_ATTACH_UTIL */
};
-#ifdef AFS_DEMAND_ATTACH_FS
+#if defined(AFS_DEMAND_ATTACH_FS) || defined(AFS_DEMAND_ATTACH_UTIL)
/*
* flag bits for 'flags' in struct VDiskLock.
*/
unsigned int flags; /**< see above for flag bits */
};
-#endif /* AFS_DEMAND_ATTACH_FS */
+#endif /* AFS_DEMAND_ATTACH_FS || AFS_DEMAND_ATTACH_UTIL */
-/* For NT, the roles of "name" and "devName" are reversed. That is, "name"
- * refers to the drive letter name and "devName" refers to the /vicep style
- * or name. The reason for this is that a lot of places assume that "name"
- * is the right thing to use to access the partition. Silly of them isn't it?
+/* For NT, the roles of "name" and "devName" are no longer reversed.
+ * That is, "name" refers to the canonical name (/vicep) style and
+ * "devName" refers to drive name.
+ *
* The NT version of VInitPartition does the intial setup. There is an NT
* variant for VGetPartition as well. Also, the VolPartitionInfo RPC does
* a swap before sending the data out on the wire.
* from the superblock */
int flags;
afs_int64 f_files; /* total number of files in this partition */
-#ifdef AFS_DEMAND_ATTACH_FS
+#if defined(AFS_DEMAND_ATTACH_FS) || defined(AFS_DEMAND_ATTACH_UTIL)
struct {
struct rx_queue head; /* list of volumes on this partition (VByPList) */
afs_uint32 len; /* length of volume list */
struct VDiskLock headerLock; /* lock for the collective headers on the partition */
struct VLockFile volLockFile; /* lock file for individual volume locks */
-#endif /* AFS_DEMAND_ATTACH_FS */
+#endif /* AFS_DEMAND_ATTACH_FS || AFS_DEMAND_ATTACH_UTIL */
};
struct DiskPartitionStats64 {
};
#define PART_DONTUPDATE 1
-#define PART_DUPLICATE 2 /* NT - used if we find more than one partition
+#define PART_DUPLICATE 2 /* NT - used if we find more than one partition
* using the same drive. Will be dumped before
* all partitions attached.
*/