afs: Remove afs_xosi 29/13529/5
authorAndrew Deason <adeason@sinenomine.net>
Fri, 28 Sep 2018 22:12:40 +0000 (17:12 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Mon, 10 Jun 2019 11:41:57 +0000 (07:41 -0400)
Since OpenAFS 1.0, all platforms in libafs have a lock called
afs_xosi, which is acquired and released around calls like VOP_GETATTR
on cache files. However, this lock doesn't appear to protect anything;
on all platforms, the code that runs while the lock is held uses only
calls VOP_GETATTR and accesses local variables (aside from
afs_osi_cred, which we use similarly in many other places). The
purpose of the lock has never been documented, and is not mentioned at
all in the afs_rwlocks text file.

The comment by the afs_xosi lock declaration suggests that the lock
was originally introduced to protect access to 'tvattr', which perhaps
was a global variable in the past. All uses of 'tvattr' are local now,
though, so protecting access to it doesn't make any sense.

So, remove afs_xosi, to remove the unnecessary serialization of
VOP_GETATTR calls.

Reviewed-on: https://gerrit.openafs.org/13350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit d75bc6370f625479a67c7c0a50cce23c4d4a4ce5)

Change-Id: I33dc7935872cf071c4221d46cbb458e1f77185a2
Reviewed-on: https://gerrit.openafs.org/13529
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

22 files changed:
src/afs/AIX/osi_file.c
src/afs/AIX/osi_prototypes.h
src/afs/DARWIN/osi_file.c
src/afs/DARWIN/osi_prototypes.h
src/afs/DFBSD/osi_prototypes.h
src/afs/FBSD/osi_file.c
src/afs/FBSD/osi_prototypes.h
src/afs/HPUX/osi_file.c
src/afs/HPUX/osi_prototypes.h
src/afs/IRIX/osi_file.c
src/afs/IRIX/osi_prototypes.h
src/afs/IRIX/osi_vnodeops.c
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_prototypes.h
src/afs/NBSD/osi_file.c
src/afs/NBSD/osi_prototypes.h
src/afs/OBSD/osi_file.c
src/afs/OBSD/osi_prototypes.h
src/afs/SOLARIS/osi_file.c
src/afs/SOLARIS/osi_prototypes.h
src/afs/afs_callback.c

index d3b66f5..a51f4c5 100644 (file)
@@ -18,7 +18,6 @@
 
 int afs_osicred_initialized = 0;
 afs_ucred_t afs_osi_cred;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct vfs *afs_cacheVfsp;
 
@@ -65,7 +64,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     afs_int32 code;
     struct vattr tvattr;
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
     code = VNOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred);
     AFS_GLOCK();
@@ -74,7 +72,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -121,7 +118,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = afs_osi_Stat(afile, &tstat);
     if (code || tstat.size <= asize)
        return code;
-    ObtainWriteLock(&afs_xosi, 321);
     /* 
      * If we're truncating an unopened file to a non-zero length,
      * we need to bind it to a vm segment    
@@ -133,7 +129,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     AFS_GUNLOCK();
     code = VNOP_FTRUNC(afile->vnode, mode, asize, (caddr_t) 0, &afs_osi_cred);
     AFS_GLOCK();
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index e6ebac3..84d31b3 100644 (file)
@@ -10,9 +10,6 @@
 #ifndef _OSI_PROTOTYPES_H_
 #define _OSI_PROTOTYPES_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
 /* osi_groups.c */
 extern void afs_aix_SetupPagRefCount(void);
 
index 19bfdf9..7af637b 100644 (file)
@@ -19,7 +19,6 @@
 
 int afs_osicred_initialized = 0;
 afs_ucred_t afs_osi_cred;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct mount *afs_cacheVfsp;
 int afs_CacheFSType = -1;
@@ -204,7 +203,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     afs_int32 code;
     struct vattr tvattr;
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
 #ifdef AFS_DARWIN80_ENV
     VATTR_INIT(&tvattr);
@@ -224,7 +222,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -260,7 +257,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = afs_osi_Stat(afile, &tstat);
     if (code || tstat.size <= asize)
        return code;
-    ObtainWriteLock(&afs_xosi, 321);
     AFS_GUNLOCK();
 #ifdef AFS_DARWIN80_ENV
     VATTR_INIT(&tvattr);
@@ -272,7 +268,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, current_proc());
 #endif
     AFS_GLOCK();
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index 0380461..c93cf5b 100644 (file)
@@ -14,9 +14,6 @@
 #ifndef _OSI_PROTO_H_
 #define _OSI_PROTO_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
 /* osi_misc.c */
 extern void darwin_notify_perms(struct unixuser *auser, int event);
 extern int osi_lookupname(char *aname, enum uio_seg seg, int followlink,
index e65ae5b..1f0392e 100644 (file)
@@ -14,9 +14,4 @@
 #ifndef _OSI_PROTO_H_
 #define _OSI_PROTO_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
-
-
 #endif /* _OSI_PROTO_H_ */
index 1cfc5c8..1e7702c 100644 (file)
@@ -20,7 +20,6 @@ int afs_osicred_initialized = 0;
 #ifndef AFS_FBSD80_ENV /* cr_groups is now malloc()'d */
 afs_ucred_t afs_osi_cred;
 #endif
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct mount *afs_cacheVfsp;
 
@@ -64,7 +63,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     afs_int32 code;
     struct vattr tvattr;
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
 #if defined(AFS_FBSD80_ENV)
     vn_lock(afile->vnode, LK_EXCLUSIVE | LK_RETRY);
@@ -81,7 +79,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -105,7 +102,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     afs_int32 code, glocked;
     AFS_STATCNT(osi_Truncate);
 
-    ObtainWriteLock(&afs_xosi, 321);
     vp = afile->vnode;
     /*
      * This routine only shrinks files, and most systems
@@ -141,7 +137,6 @@ out:
 #endif
     if (glocked)
       AFS_GLOCK();
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index c3c3b60..1e0bed8 100644 (file)
@@ -14,9 +14,6 @@
 #ifndef _OSI_PROTO_H_
 #define _OSI_PROTO_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
 /* osi_misc.c */
 extern int osi_lookupname(char *aname, enum uio_seg seg, int followlink,
                          struct vnode **vpp);
index 529f0fa..500641d 100644 (file)
@@ -19,7 +19,6 @@
 
 int afs_osicred_initialized = 0;
 afs_ucred_t afs_osi_cred;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct vfs *afs_cacheVfsp;
 
@@ -66,7 +65,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     afs_int32 code;
     struct vattr tvattr;
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
     code = VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, VSYNC);
     AFS_GLOCK();
@@ -75,7 +73,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -107,7 +104,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = afs_osi_Stat(afile, &tstat);
     if (code || tstat.size <= asize)
        return code;
-    ObtainWriteLock(&afs_xosi, 321);
     VATTR_NULL(&tvattr);
     /* note that this credential swapping stuff is only necessary because
      * of ufs's references directly to u.u_cred instead of to
@@ -119,7 +115,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, 0);
     AFS_GLOCK();
     set_p_cred(u.u_procp, oldCred);    /* restore */
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index 4bc45e9..6867e15 100644 (file)
@@ -6,7 +6,4 @@
 #ifndef _OSI_PROTO_H_
 #define _OSI_PROTO_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
 #endif /* _OSI_PROTO_H_ */
index 92bbf4c..8199454 100644 (file)
@@ -17,7 +17,6 @@
 
 afs_ucred_t afs_osi_cred;
 int afs_osicred_initialized = 0;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct vfs *afs_cacheVfsp;
 
@@ -71,7 +70,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     afs_int32 code;
     struct vattr tvattr;
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
     tvattr.va_mask = AT_SIZE | AT_BLKSIZE | AT_MTIME | AT_ATIME;
     AFS_VOP_GETATTR(afile->vnode, &tvattr, 0, &afs_osi_cred, code);
@@ -81,7 +79,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -114,13 +111,11 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = afs_osi_Stat(afile, &tstat);
     if (code || tstat.size <= asize)
        return code;
-    ObtainWriteLock(&afs_xosi, 321);
     AFS_GUNLOCK();
     tvattr.va_mask = AT_SIZE;
     tvattr.va_size = asize;
     AFS_VOP_SETATTR(afile->vnode, &tvattr, 0, &afs_osi_cred, code);
     AFS_GLOCK();
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index 53eed50..c7a8796 100644 (file)
@@ -10,7 +10,4 @@
 #ifndef _OSI_PROTOTYPES_H_
 #define _OSI_PROTOTYPES_H_
 
-/* osi_file.c */
-extern afs_lock_t afs_xosi;
-
 #endif /* _OSI_PROTOTYPES_H_ */
index 5efd81c..29aab4a 100644 (file)
@@ -1902,15 +1902,12 @@ struct vnodeops *afs_ops = &Afs_vnodeops;
 /* Initialized in osi_InitCacheFSType(). Used to determine inode type. */
 vnodeops_t *afs_xfs_vnodeopsp;
 
-extern afs_lock_t afs_xosi;    /* lock is for tvattr */
-
 ino_t
 VnodeToIno(vnode_t * vp)
 {
     int code;
     struct vattr vattr;
 
-    ObtainWriteLock(&afs_xosi, 579);
     vattr.va_mask = AT_FSID | AT_NODEID;       /* quick return using this mask. */
     AFS_GUNLOCK();
     AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code);
@@ -1918,7 +1915,6 @@ VnodeToIno(vnode_t * vp)
     if (code) {
        osi_Panic("VnodeToIno");
     }
-    ReleaseWriteLock(&afs_xosi);
     return vattr.va_nodeid;
 }
 
@@ -1928,7 +1924,6 @@ VnodeToDev(vnode_t * vp)
     int code;
     struct vattr vattr;
 
-    ObtainWriteLock(&afs_xosi, 580);
     vattr.va_mask = AT_FSID | AT_NODEID;       /* quick return using this mask. */
     AFS_GUNLOCK();
     AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code);
@@ -1936,7 +1931,6 @@ VnodeToDev(vnode_t * vp)
     if (code) {
        osi_Panic("VnodeToDev");
     }
-    ReleaseWriteLock(&afs_xosi);
     return (dev_t) vattr.va_fsid;
 }
 
@@ -1946,7 +1940,6 @@ VnodeToSize(vnode_t * vp)
     int code;
     struct vattr vattr;
 
-    ObtainWriteLock(&afs_xosi, 581);
     vattr.va_mask = AT_SIZE;
     AFS_GUNLOCK();
     AFS_VOP_GETATTR(vp, &vattr, 0, OSI_GET_CURRENT_CRED(), code);
@@ -1954,7 +1947,6 @@ VnodeToSize(vnode_t * vp)
     if (code) {
        osi_Panic("VnodeToSize");
     }
-    ReleaseWriteLock(&afs_xosi);
     return vattr.va_size;
 }
 #endif /* AFS_SGI62_ENV */
index 8dd7c39..5b0a0c0 100644 (file)
@@ -39,7 +39,6 @@
 int cache_fh_type = -1;
 int cache_fh_len = -1;
 
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct vfsmount *afs_cacheMnt;
 extern struct super_block *afs_cacheSBp;
@@ -160,12 +159,10 @@ int
 afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
 {
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     astat->size = i_size_read(OSIFILE_INODE(afile));
     astat->mtime = OSIFILE_INODE(afile)->i_mtime.tv_sec;
     astat->atime = OSIFILE_INODE(afile)->i_atime.tv_sec;
 
-    ReleaseWriteLock(&afs_xosi);
     return 0;
 }
 
@@ -198,7 +195,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = afs_osi_Stat(afile, &tstat);
     if (code || tstat.size <= asize)
        return code;
-    ObtainWriteLock(&afs_xosi, 321);
     AFS_GUNLOCK();
     afs_linux_lock_inode(inode);
 #ifdef STRUCT_INODE_HAS_I_ALLOC_SEM
@@ -224,7 +220,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
 #endif
     afs_linux_unlock_inode(inode);
     AFS_GLOCK();
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index d6172c1..2b48453 100644 (file)
@@ -50,7 +50,6 @@ int __init
 afs_init(void)
 {
     int err;
-    AFS_RWLOCK_INIT(&afs_xosi, "afs_xosi");
 
 #ifdef HAVE_LINUX_KUID_T
     afs_ns = afs_current_user_ns();
index 70f6393..130b566 100644 (file)
@@ -35,7 +35,6 @@ extern void osi_linux_nfssrv_shutdown(void);
 extern afs_rwlock_t afs_xnfssrv;
 
 /* osi_file.c */
-extern afs_rwlock_t afs_xosi;
 extern int osi_InitCacheInfo(char *aname);
 extern int osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw);
 extern struct file *afs_linux_raw_open(afs_dcache_id_t *ainode);
index dfacb69..efebc39 100644 (file)
@@ -16,7 +16,6 @@
 
 
 int afs_osicred_initialized;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct mount *afs_cacheVfsp;
 
@@ -60,7 +59,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     struct vattr tvattr;
 
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
 #ifdef AFS_NBSD50_ENV
        code = VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp);
@@ -74,7 +72,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -108,7 +105,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     if (code || tstat.size <= asize)
        return code;
 
-    ObtainWriteLock(&afs_xosi, 321);
     VATTR_NULL(&tvattr);
     tvattr.va_size = asize;
     AFS_GUNLOCK();
@@ -127,7 +123,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     AFS_GLOCK();
     if (code == 0)
        afile->size = asize;
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index 4bc45e9..6867e15 100644 (file)
@@ -6,7 +6,4 @@
 #ifndef _OSI_PROTO_H_
 #define _OSI_PROTO_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
 #endif /* _OSI_PROTO_H_ */
index 7929141..6c5ddd9 100644 (file)
@@ -18,7 +18,6 @@
 
 int afs_osicred_initialized;
 afs_ucred_t afs_osi_cred;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct mount *afs_cacheVfsp;
 
@@ -63,7 +62,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     struct vattr tvattr;
 
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     AFS_GUNLOCK();
     code = VOP_GETATTR(afile->vnode, &tvattr, afs_osi_credp, curproc);
     AFS_GLOCK();
@@ -72,7 +70,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -106,7 +103,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     if (code || tstat.size <= asize)
        return code;
 
-    ObtainWriteLock(&afs_xosi, 321);
     VATTR_NULL(&tvattr);
     tvattr.va_size = asize;
     AFS_GUNLOCK();
@@ -116,7 +112,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     AFS_GLOCK();
     if (code == 0)
        afile->size = asize;
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index 4bc45e9..6867e15 100644 (file)
@@ -6,7 +6,4 @@
 #ifndef _OSI_PROTO_H_
 #define _OSI_PROTO_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
 #endif /* _OSI_PROTO_H_ */
index a3387ec..1f81f4a 100644 (file)
@@ -18,7 +18,6 @@
 
 
 int afs_osicred_initialized = 0;
-afs_lock_t afs_xosi;           /* lock is for tvattr */
 extern struct osi_dev cacheDev;
 extern struct vfs *afs_cacheVfsp;
 
@@ -116,11 +115,6 @@ VnodeToSize(vnode_t * vp)
     int code;
     struct vattr vattr;
 
-    /*
-     * We lock xosi in osi_Stat, so we probably should
-     * lock it here too - RWH.
-     */
-    ObtainWriteLock(&afs_xosi, 578);
     vattr.va_mask = AT_SIZE;
     AFS_GUNLOCK();
 #ifdef AFS_SUN511_ENV
@@ -132,7 +126,6 @@ VnodeToSize(vnode_t * vp)
     if (code) {
        osi_Panic("VnodeToSize");
     }
-    ReleaseWriteLock(&afs_xosi);
     return (afs_int32) (vattr.va_size);
 }
 
@@ -258,7 +251,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
     afs_int32 code;
     struct vattr tvattr;
     AFS_STATCNT(osi_Stat);
-    ObtainWriteLock(&afs_xosi, 320);
     /* Ufs doesn't seem to care about the flags so we pass 0 for now */
     tvattr.va_mask = AT_ALL;
     AFS_GUNLOCK();
@@ -273,7 +265,6 @@ afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
        astat->mtime = tvattr.va_mtime.tv_sec;
        astat->atime = tvattr.va_atime.tv_sec;
     }
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
@@ -305,7 +296,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = afs_osi_Stat(afile, &tstat);
     if (code || tstat.size <= asize)
        return code;
-    ObtainWriteLock(&afs_xosi, 321);
     tvattr.va_mask = AT_SIZE;
     tvattr.va_size = asize;
     /*
@@ -318,7 +308,6 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
     code = VOP_SETATTR(afile->vnode, &tvattr, 0, afs_osi_credp);
 #endif
     AFS_GLOCK();
-    ReleaseWriteLock(&afs_xosi);
     return code;
 }
 
index 237a868..49ba3d2 100644 (file)
@@ -10,9 +10,6 @@
 #ifndef _OSI_PROTOTYPES_H_
 #define _OSI_PROTOTYPES_H_
 
-/* osi_file.c */
-extern afs_rwlock_t afs_xosi;
-
 /* osi_vnodeops.c */
 int afs_putapage(struct vnode *vp, struct page *pages, u_offset_t * offp,
                 size_t * lenp, int flags, afs_ucred_t *credp);
index 038cdda..f8b7c6a 100644 (file)
@@ -52,10 +52,6 @@ static struct ltable {
     "afs_xcbhash", (char *)&afs_xcbhash}, {
     "afs_xaxs", (char *)&afs_xaxs}, {
     "afs_xinterface", (char *)&afs_xinterface},
-#ifndef UKERNEL
-    {
-    "afs_xosi", (char *)&afs_xosi},
-#endif
     {
       "afs_xsrvAddr", (char *)&afs_xsrvAddr},
     {