2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
15 Institution: The Information Technology Center, Carnegie-Mellon University
19 #include <afs/param.h>
26 #include <sys/param.h>
27 #include <sys/types.h>
30 #include <sys/statvfs.h>
31 #endif /* AFS_HAVE_STATVFS */
33 #include <sys/mount.h>
36 #if !defined(AFS_SGI_ENV)
38 #include <sys/mount.h>
40 #else /* AFS_OSF_ENV */
41 #ifdef AFS_VFSINCL_ENV
44 #include <sys/fs/ufs_fs.h>
47 #include <ufs/ufs/dinode.h>
48 #include <ufs/ffs/fs.h>
53 #else /* AFS_VFSINCL_ENV */
54 #if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
57 #endif /* AFS_VFSINCL_ENV */
58 #endif /* AFS_OSF_ENV */
59 #include <sys/errno.h>
65 #include <sys/lockf.h>
71 #include <checklist.h>
73 #if defined(AFS_SUN_ENV)
78 #include <sys/mnttab.h>
79 #include <sys/mntent.h>
81 #ifdef AFS_LINUX22_ENV
83 #include <sys/statfs.h>
90 #endif /* AFS_SGI_ENV */
91 #endif /* AFS_NT40_ENV */
92 #if defined(AFS_SGI_ENV)
93 #include <sys/errno.h>
101 #include <afs/afsint.h>
103 #include <afs/errors.h>
106 #include <afs/afssyscalls.h>
112 #include "namei_ops.h"
113 #if defined(AFS_SGI_ENV)
117 #endif /* AFS_SGI_ENV */
118 #endif /* AFS_NT40_ENV */
119 #endif /* AFS_NAMEI_ENV */
122 #include "partition.h"
123 #ifdef AFS_PTHREAD_ENV
125 #else /* AFS_PTHREAD_ENV */
126 #include <afs/assert.h>
127 #endif /* AFS_PTHREAD_ENV */
129 #if defined(AFS_HPUX_ENV)
130 #include <sys/types.h>
131 #include <sys/privgrp.h>
132 #endif /* defined(AFS_HPUX_ENV) */
135 #include <jfs/filsys.h>
138 int aixlow_water = 8; /* default 8% */
139 struct DiskPartition *DiskPartitionList;
141 #ifdef AFS_SGI_XFS_IOPS_ENV
142 /* Verify that the on disk XFS inodes on the partition are large enough to
143 * hold the AFS attribute. Returns -1 if the attribute can't be set or is
144 * too small to fit in the inode. Returns 0 if the attribute does fit in
147 #include <afs/xfsattrs.h>
148 static int VerifyXFSInodeSize(char *part, char *fstype)
151 int length = SIZEOF_XFS_ATTR_T;
156 if (strcmp("xfs", fstype))
159 if (attr_set(part, AFS_XFS_ATTR, &junk, length, ATTR_ROOT) == 0) {
160 if (((fd=open(part, O_RDONLY, 0)) != -1)
161 && (fcntl(fd, F_FSGETXATTRA, &fsx) == 0)) {
163 if (fsx.fsx_nextents) {
164 Log("Partition %s: XFS inodes too small, exiting.\n", part);
165 Log("Run xfs_size_check utility and remake partitions.\n");
173 (void) attr_remove(part, AFS_XFS_ATTR, ATTR_ROOT);
180 static void VInitPartition_r(char *path, char *devname, Device dev)
182 struct DiskPartition *dp, *op;
183 dp = (struct DiskPartition *) malloc(sizeof (struct DiskPartition));
184 /* Add it to the end, to preserve order when we print statistics */
185 for (op = DiskPartitionList; op; op = op->next) {
192 DiskPartitionList = dp;
194 strcpy(dp->name, path);
195 #if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
197 strcpy(dp->devName, devname);
198 #else /* AFS_SUN5_ENV */
199 strcpy(dp->devName, path);
201 dp->device = volutil_GetPartitionID(path);
203 strcpy(dp->devName, devname);
208 dp->f_files = 1; /* just a default value */
209 #if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
210 if (programType == fileServer)
211 (void) namei_ViceREADME(VPartitionPath(dp));
213 VSetPartitionDiskUsage_r(dp);
216 static void VInitPartition(char *path, char *devname, Device dev)
219 VInitPartition_r(path, devname, dev);
224 /* VAttachPartitions() finds the vice partitions on this server. Calls
225 * VCheckPartition() to do some basic checks on the partition. If the partition
226 * is a valid vice partition, VCheckPartition will add it to the DiskPartition
228 * Returns the number of errors returned by VCheckPartition. An error in
229 * VCheckPartition means that partition is a valid vice partition but the
230 * fileserver should not start because of the error found on that partition.
233 * No specific user space file system checks, since we don't know what
234 * is being used for vice partitions.
236 * Use partition name as devname.
238 int VCheckPartition(part, devname)
243 #if !defined(AFS_LINUX20_ENV) && !defined(AFS_NT40_ENV)
244 char AFSIDatPath[MAXPATHLEN];
247 /* Only keep track of "/vicepx" partitions since it can get hairy
248 * when NFS mounts are involved.. */
249 if (strncmp(part, VICE_PARTITION_PREFIX, VICE_PREFIX_SIZE)) {
252 if (stat(part, &status) < 0) {
253 Log("VInitVnodes: Couldn't find file system %s; ignored\n", part);
257 #ifndef AFS_AIX32_ENV
258 if (programType == fileServer) {
259 char salvpath[MAXPATHLEN];
260 strcpy(salvpath, part);
261 strcat(salvpath, "/FORCESALVAGE");
262 if (stat(salvpath, &status) == 0) {
263 Log("VInitVnodes: Found %s; aborting\n", salvpath);
269 #if !defined(AFS_LINUX20_ENV) && !defined(AFS_NT40_ENV)
270 strcpy(AFSIDatPath, part);
271 strcat(AFSIDatPath, "/AFSIDat");
273 if (stat(AFSIDatPath, &status) < 0) {
277 dirp = opendir(part);
279 while (dp = readdir(dirp)) {
280 if (dp->d_name[0] == 'V') {
281 Log("This program is compiled with AFS_NAMEI_ENV, but partition %s seems to contain volumes which don't use the namei-interface; aborting\n", part);
288 #else /* AFS_NAMEI_ENV */
289 if (stat(AFSIDatPath, &status) == 0) {
290 Log("This program is compiled without AFS_NAMEI_ENV, but partition %s seems to contain volumes which use the namei-interface; aborting\n", part);
293 #endif /* AFS_NAMEI_ENV */f
296 #ifdef AFS_SGI_XFS_IOPS_ENV
297 if (VerifyXFSInodeSize(part, status.st_fstype) < 0)
302 if (status.st_ino != ROOTINO) {
303 Log("%s is not a mounted file system; ignored.\n", part);
308 VInitPartition(part, devname, status.st_dev);
312 #endif /* AFS_NT40_ENV */
315 int VAttachPartitions(void)
321 if (!(mntfile = fopen(MNTTAB, "r"))) {
322 Log("Can't open %s\n", MNTTAB);
326 while (!getmntent(mntfile, &mnt)) {
327 /* Ignore non ufs or non read/write partitions */
328 if ((strcmp(mnt.mnt_fstype, "ufs") !=0) ||
329 (strncmp(mnt.mnt_mntopts, "ro,ignore",9) ==0))
332 if (VCheckPartition(mnt.mnt_mountp, mnt.mnt_special) < 0 )
336 (void) fclose(mntfile);
341 #endif /* AFS_SUN5_ENV */
342 #if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_HPUX_ENV)
343 int VAttachPartitions(void)
347 struct mntent *mntent;
349 if ((mfd = setmntent(MOUNTED, "r")) == NULL) {
350 Log("Problems in getting mount entries(setmntent)\n");
353 while (mntent = getmntent(mfd)) {
354 if (!hasmntopt(mntent, MNTOPT_RW)) continue;
356 if (VCheckPartition(mntent->mnt_dir, mntent->mnt_fsname) < 0 )
367 * (This function was grabbed from df.c)
371 register struct vmount **vmountpp; /* place to tell where buffer is */
374 register struct vmount *vm;
377 /* set initial size of mntctl buffer to a MAGIC NUMBER */
380 /* try the operation until ok or a fatal error */
382 if ((vm = (struct vmount *)malloc(size)) == NULL) {
383 /* failed getting memory for mount status buf */
384 perror("FATAL ERROR: get_stat malloc failed\n");
389 * perform the QUERY mntctl - if it returns > 0, that is the
390 * number of vmount structures in the buffer. If it returns
391 * -1, an error occured. If it returned 0, then look in
392 * first word of buffer for needed size.
394 if ((nmounts = mntctl(MCTL_QUERY, size, (caddr_t)vm)) > 0) {
395 /* OK, got it, now return */
399 } else if (nmounts == 0) {
400 /* the buffer wasn't big enough .... */
401 /* .... get required buffer size */
406 /* some other kind of error occurred */
413 int VAttachPartitions(void)
417 struct vmount *vmountp;
419 if ((nmounts = getmount(&vmountp)) <= 0) {
420 Log("Problems in getting # of mount entries(getmount)\n");
423 for (; nmounts; nmounts--,
424 vmountp = (struct vmount *)((int)vmountp + vmountp->vmt_length)) {
425 char *part = vmt2dataptr(vmountp, VMT_STUB);
427 if (vmountp->vmt_flags & (MNT_READONLY|MNT_REMOVABLE|MNT_REMOTE))
428 continue; /* Ignore any "special" partitions */
432 struct superblock fs;
433 /* The Log statements are non-sequiters in the SalvageLog and don't
434 * even appear in the VolserLog, so restrict them to the FileLog.
436 if (ReadSuper(&fs, vmt2dataptr(vmountp, VMT_OBJECT))<0) {
437 if (programType == fileServer)
438 Log("Can't read superblock for %s, ignoring it.\n", part);
441 if (IsBigFilesFileSystem(&fs)) {
442 if (programType == fileServer)
443 Log("%s is a big files filesystem, ignoring it.\n", part);
449 if (VCheckPartition(part, vmt2dataptr(vmountp, VMT_OBJECT)) < 0 )
456 #if defined(AFS_DUX40_ENV) || defined(AFS_DARWIN_ENV)
457 int VAttachPartitions(void)
462 if (setfsent() < 0) {
463 Log("Error listing filesystems.\n");
467 while (fsent = getfsent()) {
468 if (strcmp(fsent->fs_type, "rw") != 0) continue;
470 if (VCheckPartition(fsent->fs_file, fsent->fs_spec) < 0 )
481 #include <sys/stat.h>
484 * validate names in vptab.
491 int VValidVPTEntry(struct vptab *vpe)
493 int len = strlen(vpe->vp_name);
496 if (len < VICE_PREFIX_SIZE+1 || len > VICE_PREFIX_SIZE + 2)
498 if (strncmp(vpe->vp_name, VICE_PARTITION_PREFIX, VICE_PREFIX_SIZE))
501 for (i=VICE_PREFIX_SIZE; i<len; i++) {
502 if (vpe->vp_name[i] < 'a' || vpe->vp_name[i] > 'z') {
503 Log("Invalid partition name %s in registry, ignoring it.\n",
508 if (len == VICE_PREFIX_SIZE + 2) {
509 i = (int)(vpe->vp_name[VICE_PREFIX_SIZE]-'a') * 26 +
510 (int)(vpe->vp_name[VICE_PREFIX_SIZE+1]-'a') ;
512 Log("Invalid partition name %s in registry, ignoring it.\n",
518 len = strlen(vpe->vp_dev);
519 if (len != 2 || vpe->vp_dev[1] != ':' || vpe->vp_dev[0] < 'A' ||
520 vpe->vp_dev[0] > 'Z') {
521 Log("Invalid device name %s in registry, ignoring it.\n",
529 int VCheckPartition(char *partName)
536 /* partName is presumed to be of the form "X:" */
537 (void) sprintf(volRoot, "%c:\\", *partName);
539 if (!GetVolumeInformation(volRoot, /* volume root directory */
540 NULL, /* volume name buffer */
541 0, /* volume name size */
542 NULL, /* volume serial number */
543 &dwDummy, /* max component length */
544 &dwDummy, /* file system flags */
545 volFsType, /* file system name */
546 sizeof(volFsType))) {
547 err = GetLastError();
548 Log("VCheckPartition: Failed to get partition information for %s, ignoring it.\n",
553 if (strcmp(volFsType, "NTFS")) {
554 Log("VCheckPartition: Partition %s is not an NTFS partition, ignoring it.\n", partName);
562 int VAttachPartitions(void)
564 struct DiskPartition *partP, *prevP, *nextP;
565 struct vpt_iter iter;
568 if (vpt_Start(&iter)<0) {
569 Log("No partitions to attach.\n");
573 while (0==vpt_NextEntry(&iter, &entry)) {
574 if (!VValidVPTEntry(&entry)) {
578 /* This test for duplicates relies on the fact that the method
579 * of storing the partition names in the NT registry means the same
580 * partition name will never appear twice in the list.
582 for (partP = DiskPartitionList; partP; partP = partP->next) {
583 if (*partP->devName == *entry.vp_dev) {
584 Log("Same drive (%s) used for both partition %s and partition %s, ignoring both.\n", entry.vp_dev, partP->name, entry.vp_name);
585 partP->flags = PART_DUPLICATE;
586 break; /* Only one entry will ever be in this list. */
589 if (partP) continue; /* found a duplicate */
591 if (VCheckPartition(entry.vp_dev)<0)
593 /* This test allows for manually inserting the FORCESALVAGE flag
594 * and thereby invoking the salvager. scandisk obviously won't be
597 if (programType == fileServer) {
599 char salvpath[MAXPATHLEN];
600 strcpy(salvpath, entry.vp_dev);
601 strcat(salvpath, "\\FORCESALVAGE");
602 if (stat(salvpath, &status) == 0) {
603 Log("VAttachPartitions: Found %s; aborting\n", salvpath);
607 VInitPartition(entry.vp_name, entry.vp_dev, *entry.vp_dev - 'A');
611 /* Run through partition list and clear out the dupes. */
612 prevP = nextP = NULL;
613 for (partP = DiskPartitionList; partP; partP = nextP) {
615 if (partP->flags == PART_DUPLICATE) {
617 prevP->next = partP->next;
619 DiskPartitionList = partP->next;
630 #ifdef AFS_LINUX22_ENV
631 int VAttachPartitions(void)
635 struct mntent *mntent;
637 if ((mfd = setmntent("/proc/mounts", "r")) == NULL) {
638 if ((mfd = setmntent("/etc/mtab", "r")) == NULL) {
639 Log("Problems in getting mount entries(setmntent)\n");
643 while (mntent = getmntent(mfd)) {
644 if (VCheckPartition(mntent->mnt_dir, mntent->mnt_fsname) < 0 )
651 #endif /* AFS_LINUX22_ENV */
653 /* This routine is to be called whenever the actual name of the partition
654 * is required. The canonical name is still in part->name.
656 char * VPartitionPath(struct DiskPartition *part)
659 return part->devName;
665 /* get partition structure, abortp tells us if we should abort on failure */
666 struct DiskPartition *VGetPartition_r(char *name, int abortp)
668 register struct DiskPartition *dp;
669 for (dp = DiskPartitionList; dp; dp = dp->next) {
670 if (strcmp(dp->name, name) == 0)
678 struct DiskPartition *VGetPartition(char *name, int abortp)
680 struct DiskPartition *retVal;
682 retVal = VGetPartition_r(name, abortp);
688 void VSetPartitionDiskUsage_r(register struct DiskPartition *dp)
690 ULARGE_INTEGER free_user, total, free_total;
691 int ufree, tot, tfree;
693 if (!GetDiskFreeSpaceEx(VPartitionPath(dp), &free_user, &total,
695 printf("Failed to get disk space info for %s, error = %d\n",
696 dp->name, GetLastError());
700 /* Convert to 1K units. */
701 ufree = (int) Int64ShraMod32(free_user.QuadPart, 10);
702 tot = (int) Int64ShraMod32(total.QuadPart, 10);
703 tfree = (int) Int64ShraMod32(free_total.QuadPart, 10);
705 dp->minFree = tfree - ufree; /* only used in VPrintDiskStats_r */
706 dp->totalUsable = tot;
711 void VSetPartitionDiskUsage_r(register struct DiskPartition *dp)
714 int fd, totalblks, free, used, availblks, bsize, code;
717 struct statvfs statbuf;
719 struct statfs statbuf;
722 if (dp->flags & PART_DONTUPDATE)
724 /* Note: we don't bother syncing because it's only an estimate, update
725 is syncing every 30 seconds anyway, we only have to keep the disk
726 approximately 10% from full--you just can't get the stuff in from
727 the net fast enough to worry */
729 code = statvfs(dp->name, &statbuf);
731 code = statfs(dp->name, &statbuf);
734 Log("statfs of %s failed in VSetPartitionDiskUsage (errno = %d)\n", dp->name, errno);
737 if (statbuf.f_blocks == -1) { /* Undefined; skip stats.. */
738 Log("statfs of %s failed in VSetPartitionDiskUsage\n", dp->name);
741 totalblks = statbuf.f_blocks;
742 free = statbuf.f_bfree;
743 reserved = free - statbuf.f_bavail;
745 bsize = statbuf.f_frsize;
747 bsize = statbuf.f_bsize;
749 availblks = totalblks - reserved;
750 dp->f_files = statbuf.f_files; /* max # of files in partition */
752 /* Now free and totalblks are in fragment units, but we want them in
756 free *= (bsize/1024);
757 totalblks *= (bsize / 1024);
758 availblks *= (bsize / 1024 );
759 reserved *= (bsize / 1024 );
762 free /= (1024/bsize);
763 totalblks /= (1024/bsize);
764 availblks /= (1024/bsize);
765 reserved /= (1024/bsize);
767 /* now compute remaining figures */
768 used = totalblks - free;
770 dp->minFree = reserved; /* only used in VPrintDiskStats_r */
771 dp->totalUsable = availblks;
772 dp->free = availblks - used; /* this is exactly f_bavail */
774 #endif /* AFS_NT40_ENV */
776 void VSetPartitionDiskUsage(register struct DiskPartition *dp)
779 VSetPartitionDiskUsage_r(dp);
783 void VResetDiskUsage_r(void)
785 struct DiskPartition *dp;
786 for (dp = DiskPartitionList; dp; dp = dp->next) {
787 VSetPartitionDiskUsage_r(dp);
788 #ifndef AFS_PTHREAD_ENV
790 #endif /* !AFS_PTHREAD_ENV */
794 void VResetDiskUsage(void)
801 void VAdjustDiskUsage_r(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 checkBlocks)
803 afs_int32 rem, minavail;
805 /* why blocks instead of checkBlocks in the check below? Otherwise, any check
806 for less than BlocksSpare would skip the error-checking path, and we
807 could grow existing files forever, not just for another BlocksSpare
811 if ((rem = vp->partition->free - checkBlocks) <
812 (minavail = (vp->partition->totalUsable * aixlow_water) / 100))
814 if (vp->partition->free - checkBlocks < 0)
817 else if (V_maxquota(vp) && V_diskused(vp) + checkBlocks > V_maxquota(vp))
820 vp->partition->free -= blocks;
821 V_diskused(vp) += blocks;
824 void VAdjustDiskUsage(Error *ec, Volume *vp, afs_int32 blocks, afs_int32 checkBlocks)
827 VAdjustDiskUsage_r(ec, vp, blocks, checkBlocks);
831 int VDiskUsage_r(Volume *vp, afs_int32 blocks)
833 afs_int32 rem, minavail;
836 if ((rem = vp->partition->free - blocks) <
837 (minavail = (vp->partition->totalUsable * aixlow_water) / 100))
839 if (vp->partition->free - blocks < 0)
843 vp->partition->free -= blocks;
847 int VDiskUsage(Volume *vp, afs_int32 blocks)
851 retVal = VDiskUsage_r(vp, blocks);
856 void VPrintDiskStats_r(void)
858 struct DiskPartition *dp;
859 for (dp = DiskPartitionList; dp; dp = dp->next) {
860 Log("Partition %s: %d available 1K blocks (minfree=%d), ",
861 dp->name, dp->totalUsable, dp->minFree);
863 Log("overallocated by %d blocks\n", -dp->free);
865 Log("%d free blocks\n", dp->free);
869 void VPrintDiskStats(void)
877 /* Need a separate lock file on NT, since NT only has mandatory file locks. */
878 #define LOCKFILE "LOCKFILE"
879 void VLockPartition_r(char *name)
881 struct DiskPartition *dp = VGetPartition_r(name, 0);
885 if (dp->lock_fd == -1) {
888 (void) sprintf(path, "%s\\%s", VPartitionPath(dp), LOCKFILE);
889 dp->lock_fd = (int)CreateFile(path, GENERIC_WRITE,
890 FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
891 CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL);
892 assert (dp->lock_fd != (int)INVALID_HANDLE_VALUE);
894 memset((char*)&lap, 0, sizeof(lap));
895 rc = LockFileEx((HANDLE)dp->lock_fd, LOCKFILE_EXCLUSIVE_LOCK,
901 void VUnlockPartition_r(char *name)
903 register struct DiskPartition *dp = VGetPartition_r(name, 0);
906 if (!dp) return; /* no partition, will fail later */
907 memset((char*)&lap, 0, sizeof(lap));
909 UnlockFileEx((HANDLE)dp->lock_fd, 0, 1, 0, &lap);
910 CloseHandle((HANDLE)dp->lock_fd);
913 #else /* AFS_NT40_ENV */
915 #if defined(AFS_HPUX_ENV)
916 #define BITS_PER_CHAR (8)
917 #define BITS(type) (sizeof(type) * BITS_PER_CHAR)
919 #define LOCKRDONLY_OFFSET ((PRIV_LOCKRDONLY - 1) / BITS(int))
920 #endif /* defined(AFS_HPUX_ENV) */
922 void VLockPartition_r(char *name)
924 register struct DiskPartition *dp = VGetPartition_r(name, 0);
927 struct timeval pausing;
928 #if defined(AFS_HPUX_ENV)
930 struct privgrp_map privGrpList[PRIV_MAXGRPS];
931 unsigned int *globalMask;
933 #endif /* defined(AFS_HPUX_ENV) */
935 if (!dp) return; /* no partition, will fail later */
936 if (dp->lock_fd != -1) return;
938 #if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
939 partitionName = dp->devName;
942 partitionName = dp->name;
946 for (retries=25; retries; retries--) {
947 dp->lock_fd = open(partitionName, code);
948 if (dp->lock_fd != -1) break;
950 pausing.tv_usec = 500000;
951 select(0, NULL, NULL, NULL, &pausing);
953 assert(retries != 0);
955 #if defined (AFS_HPUX_ENV)
957 assert(getprivgrp(privGrpList) == 0);
960 * In general, it will difficult and time-consuming ,if not impossible,
961 * to try to find the privgroup to which this process belongs that has the
962 * smallest membership, to minimise the security hole. So, we use the privgrp
963 * to which everybody belongs.
965 /* first, we have to find the global mask */
966 for (globalMaskIndex = 0; globalMaskIndex < PRIV_MAXGRPS;
968 if (privGrpList[globalMaskIndex].priv_groupno == PRIV_GLOBAL) {
969 globalMask = &(privGrpList[globalMaskIndex].
970 priv_mask[LOCKRDONLY_OFFSET]);
975 if (((*globalMask) & privmask(PRIV_LOCKRDONLY)) == 0) {
976 /* allow everybody to set a lock on a read-only file descriptor */
977 (*globalMask) |= privmask(PRIV_LOCKRDONLY);
978 assert(setprivgrp(PRIV_GLOBAL,
979 privGrpList[globalMaskIndex].priv_mask) == 0);
981 lockfRtn = lockf(dp->lock_fd, F_LOCK, 0);
983 /* remove the privilege granted to everybody to lock a read-only fd */
984 (*globalMask) &= ~(privmask(PRIV_LOCKRDONLY));
985 assert(setprivgrp(PRIV_GLOBAL,
986 privGrpList[globalMaskIndex].priv_mask) == 0);
989 /* in this case, we should be able to do this with impunity, anyway */
990 lockfRtn = lockf(dp->lock_fd, F_LOCK, 0);
993 assert (lockfRtn != -1);
995 #if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
996 assert (lockf(dp->lock_fd, F_LOCK, 0) != -1);
998 assert (flock(dp->lock_fd, LOCK_EX) == 0);
999 #endif /* defined(AFS_AIX_ENV) */
1003 void VUnlockPartition_r(char *name)
1005 register struct DiskPartition *dp = VGetPartition_r(name, 0);
1006 if (!dp) return; /* no partition, will fail later */
1011 #endif /* AFS_NT40_ENV */
1013 void VLockPartition(char *name)
1016 VLockPartition_r(name);
1020 void VUnlockPartition(char *name)
1023 VUnlockPartition_r(name);