255 partitions are allowed. The File Server expects that the /vicepXX
directories are each on a dedicated filesystem. The File Server will
only use a /vicepXX if it's a mountpoint for another filesystem,
-unless the file C</vicepXX/AlwaysAttach> exists. The data in the
-partition is a special format that can only be access using OpenAFS
-commands or an OpenAFS client.
+unless the file C</vicepXX/AlwaysAttach> exists. A partition will not be
+mounted if the file C</vicepXX/NeverAttach> exists. If both
+C</vicepXX/AlwaysAttach> and C</vicepXX/NeverAttach> are present, then
+C</vicepXX/AlwaysAttach> wins. The data in the partition is a special
+format that can only be access using OpenAFS commands or an OpenAFS
+client.
The File Server generates the following message when a partition is nearly
full:
#endif /* AFS_NAMEI_ENV */
}
+/* VIsNeverAttach() checks whether a /vicepX directory should never be
+ * attached (return value 1), or follow the normal mounting logic. The
+ * Always Attach flag may override the NeverAttach flag.
+ */
+static int
+VIsNeverAttach(char *part)
+{
+ struct afs_stat_st st;
+ char checkfile[256];
+ int ret;
+
+ if (strncmp(part, VICE_PARTITION_PREFIX, VICE_PREFIX_SIZE))
+ return 0;
+
+ strncpy(checkfile, part, 100);
+ strcat(checkfile, OS_DIRSEP);
+ strcat(checkfile, VICE_NEVERATTACH_FILE);
+
+ ret = afs_stat(checkfile, &st);
+ return (ret < 0) ? 0 : 1;
+}
+
/* VAttachPartitions2() looks for and attaches /vicepX partitions
* where a special file (VICE_ALWAYSATTACH_FILE) exists. This is
* used to attach /vicepX directories which aren't on dedicated
|| (strncmp(mnt.mnt_mntopts, "ro,ignore", 9) == 0))
continue;
+ /* Skip this Partition? */
+ if (VIsNeverAttach(mntent->mnt_dir))
+ continue;
+
/* If we're going to always attach this partition, do it later. */
if (VIsAlwaysAttach(mnt.mnt_mountp, NULL))
continue;
if (!hasmntopt(mntent, MNTOPT_RW))
continue;
+ /* Skip this Partition? */
+ if (VIsNeverAttach(mntent->mnt_dir))
+ continue;
+
/* If we're going to always attach this partition, do it later. */
if (VIsAlwaysAttach(mntent->mnt_dir, NULL))
continue;
#endif
#endif
+ /* Skip this Partition? */
+ if (VIsNeverAttach(mntent->mnt_dir))
+ continue;
+
/* If we're going to always attach this partition, do it later. */
if (VIsAlwaysAttach(part, NULL))
continue;
if (strcmp(fsent->fs_type, "rw") != 0)
continue;
+ /* Skip this Partition? */
+ if (VIsNeverAttach(mntent->mnt_dir))
+ continue;
+
/* If we're going to always attach this partition, do it later. */
if (VIsAlwaysAttach(fsent->fs_file, NULL))
continue;
}
}
while ((mntent = getmntent(mfd))) {
+ /* Skip this Partition? */
+ if (VIsNeverAttach(mntent->mnt_dir))
+ continue;
+
/* If we're going to always attach this partition, do it later. */
if (VIsAlwaysAttach(mntent->mnt_dir, NULL))
continue;