/* Static prototypes */
-static int HandleGetLock(register struct vcache *avc,
- register struct AFS_FLOCK *af,
- register struct vrequest *areq, int clid);
+static int HandleGetLock(struct vcache *avc,
+ struct AFS_FLOCK *af,
+ struct vrequest *areq, int clid);
static int GetFlockCount(struct vcache *avc, struct vrequest *areq);
static int lockIdcmp2(struct AFS_FLOCK *flock1, struct vcache *vp,
- register struct SimpleLocks *alp, int onlymine,
+ struct SimpleLocks *alp, int onlymine,
int clid);
static void DoLockWarning(afs_ucred_t * acred);
static int
lockIdcmp2(struct AFS_FLOCK *flock1, struct vcache *vp,
- register struct SimpleLocks *alp, int onlymine, int clid)
+ struct SimpleLocks *alp, int onlymine, int clid)
{
- register struct SimpleLocks *slp;
+ struct SimpleLocks *slp;
#if defined(AFS_SUN5_ENV)
- register proc_t *procp = ttoproc(curthread);
+ proc_t *procp = ttoproc(curthread);
#else
#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
#ifdef AFS_SGI64_ENV
*/
/* clid - nonzero on sgi sunos osf1 only */
int
-HandleFlock(register struct vcache *avc, int acom, struct vrequest *areq,
+HandleFlock(struct vcache *avc, int acom, struct vrequest *areq,
pid_t clid, int onlymine)
{
struct afs_conn *tc;
}
}
} else if (avc->flockCount == -1) {
- afs_StoreAllSegments(avc, areq, AFS_ASYNC); /* fsync file early */
+ afs_StoreAllSegments(avc, areq, AFS_SYNC | AFS_VMSYNC); /* fsync file early */
avc->flockCount = 0;
/* And remove the (only) exclusive lock entry from the list... */
osi_FreeSmallSpace(avc->slocks);
(tc, code, &avc->f.fid, areq,
AFS_STATS_FS_RPCIDX_SETLOCK, SHARED_LOCK,
NULL));
+ if ((lockType == LockWrite) && (code == VREADONLY))
+ code = EBADF; /* per POSIX; VREADONLY == EROFS */
} else
/* XXX - Should probably try and log this when we're
* XXX - running with logging enabled. But it's horrid
static void
DoLockWarning(afs_ucred_t * acred)
{
- register afs_int32 now;
+ afs_int32 now;
pid_t pid = MyPidxx2Pid(MyPidxx);
char *procname;
lastWarnPid = pid;
#ifdef AFS_LINUX26_ENV
afs_warnuser
- ("afs: byte-range locks only enforced for processes on this machine (pid %d (%s), user %ld).\n", pid, procname, afs_cr_uid(acred));
+ ("afs: byte-range locks only enforced for processes on this machine (pid %d (%s), user %ld).\n", pid, procname, (long)afs_cr_uid(acred));
#else
afs_warnuser
("afs: byte-range lock/unlock ignored; make sure no one else is running this program (pid %d (%s), user %ld).\n", pid, procname, afs_cr_uid(acred));
* PID has the file read locked.
*/
static int
-HandleGetLock(register struct vcache *avc, register struct AFS_FLOCK *af,
- register struct vrequest *areq, int clid)
+HandleGetLock(struct vcache *avc, struct AFS_FLOCK *af,
+ struct vrequest *areq, int clid)
{
- register afs_int32 code;
+ afs_int32 code;
struct AFS_FLOCK flock;
lockIdSet(&flock, NULL, clid);
static int
GetFlockCount(struct vcache *avc, struct vrequest *areq)
{
- register struct afs_conn *tc;
- register afs_int32 code;
+ struct afs_conn *tc;
+ afs_int32 code;
struct AFSFetchStatus OutStatus;
struct AFSCallBack CallBack;
struct AFSVolSync tsync;