Index: namei_ops.c =================================================================== RCS file: /cvs/openafs/src/vol/namei_ops.c,v retrieving revision 1.2 diff -u -r1.2 namei_ops.c --- namei_ops.c 2000/11/04 10:06:23 1.2 +++ namei_ops.c 2001/03/27 06:49:36 @@ -22,6 +22,12 @@ #include #include #include +#ifdef AFS_AIX_ENV +#include +#endif +#ifdef AFS_SUN5_ENV +#include +#endif #include #include #include "nfs.h" @@ -805,7 +811,11 @@ namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); if (lockit) { +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + if (lockf(h->fd_fd, F_LOCK, 0) < 0) +#else if (flock(h->fd_fd, LOCK_EX)<0) +#endif return -1; } @@ -820,7 +830,11 @@ bad_getLinkByte: if (lockit) +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(h->fd_fd, F_ULOCK, 0); +#else flock(h->fd_fd, LOCK_UN); +#endif return -1; } @@ -834,13 +848,16 @@ short row; int code; - fdP = IH_OPEN(ih); if (fdP == NULL) return -1; /* Only one manipulates at a time. */ +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { +#else if (flock(fdP->fd_fd, LOCK_EX)<0) { +#endif FDH_REALLYCLOSE(fdP); return -1; } @@ -877,12 +894,20 @@ goto badGetFreeTag; } FDH_SYNC(fdP); +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(fdP->fd_fd, F_ULOCK, 0); +#else flock(fdP->fd_fd, LOCK_UN); +#endif FDH_REALLYCLOSE(fdP); return col;; badGetFreeTag: +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(fdP->fd_fd, F_ULOCK, 0); +#else flock(fdP->fd_fd, LOCK_UN); +#endif FDH_REALLYCLOSE(fdP); return -1; } @@ -902,9 +927,12 @@ namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); - if (!locked) { +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { +#else if (flock(fdP->fd_fd, LOCK_EX)<0) { +#endif return -1; } } @@ -943,7 +971,11 @@ bad_SetLinkCount: +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(fdP->fd_fd, F_ULOCK, 0); +#else flock(fdP->fd_fd, LOCK_UN); +#endif return code; }