mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
afs: Fix a few ARCH/osi_vcache.c style errors
Most of the ARCH/osi_vcache.c implementations were defining functions like: void osi_foo(args) { /* impl */ } But our prevailing style is: void osi_foo(args) { /* impl */ } Fix them to follow our prevailing style, and fix a couple of the more obvious errors with identation and goto label. Reviewed-on: https://gerrit.openafs.org/13699 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> (cherry picked from commit ee7019a7630d01f29fecebd89ca69ad8a37e24e2) Change-Id: I2a34a0d8fd7b6c3721ede0c40c212c3993402235 Reviewed-on: https://gerrit.openafs.org/15400 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
parent
f6fbb85c00
commit
7f9445bbeb
@ -16,19 +16,21 @@
|
||||
extern struct vnodeops *afs_ops;
|
||||
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
int code;
|
||||
if (!VREFCOUNT_GT(avc,0)
|
||||
&& avc->opens == 0 && (avc->f.states & CUnlinkedDel) == 0) {
|
||||
code = afs_FlushVCache(avc, slept);
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
int code;
|
||||
if (!VREFCOUNT_GT(avc,0)
|
||||
&& avc->opens == 0 && (avc->f.states & CUnlinkedDel) == 0) {
|
||||
code = afs_FlushVCache(avc, slept);
|
||||
if (code == 0)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
struct vcache *tvc;
|
||||
|
||||
tvc = afs_osi_Alloc(sizeof(struct vcache));
|
||||
@ -44,7 +46,8 @@ osi_NewVnode(void) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(avc, 0, sizeof(struct vcache));
|
||||
|
||||
#ifdef AFS_AIX32_ENV
|
||||
@ -59,10 +62,13 @@ osi_PrePopulateVCache(struct vcache *avc) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_AttachVnode(struct vcache *avc, int seq) { }
|
||||
osi_AttachVnode(struct vcache *avc, int seq)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
avc->v.v_op = afs_ops;
|
||||
|
||||
avc->v.v_vfsp = afs_globalVFS;
|
||||
|
@ -14,7 +14,8 @@
|
||||
#include "afsincludes.h" /*AFS-based standard headers */
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
struct vcache *tvc;
|
||||
|
||||
tvc = afs_osi_Alloc(sizeof(struct vcache));
|
||||
@ -29,7 +30,8 @@ osi_NewVnode(void) {
|
||||
|
||||
#if defined(AFS_DARWIN80_ENV)
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
*slept = 0;
|
||||
|
||||
/* we ignore defersleep, as we *always* need to sleep */
|
||||
@ -64,7 +66,8 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
}
|
||||
#else
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
if (!VREFCOUNT_GT(avc,0)
|
||||
|| ((VREFCOUNT(avc) == 1) && (UBCINFOEXISTS(AFSTOV(avc))))
|
||||
&& avc->opens == 0 && (avc->f.states & CUnlinkedDel) == 0)
|
||||
@ -85,12 +88,14 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
#endif /* AFS_DARWIN80_ENV */
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(avc, 0, sizeof(struct vcache));
|
||||
}
|
||||
|
||||
void
|
||||
osi_AttachVnode(struct vcache *avc, int seq) {
|
||||
osi_AttachVnode(struct vcache *avc, int seq)
|
||||
{
|
||||
ReleaseWriteLock(&afs_xvcache);
|
||||
AFS_GUNLOCK();
|
||||
afs_darwin_getnewvnode(avc); /* includes one refcount */
|
||||
@ -104,7 +109,8 @@ osi_AttachVnode(struct vcache *avc, int seq) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
#if !defined(AFS_DARWIN80_ENV)
|
||||
avc->v->v_mount = afs_globalVFS;
|
||||
vSetType(avc, VREG);
|
||||
|
@ -65,7 +65,8 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
}
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
struct vcache *tvc;
|
||||
|
||||
tvc = afs_osi_Alloc(sizeof(struct vcache));
|
||||
@ -78,12 +79,14 @@ osi_NewVnode(void) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(avc, 0, sizeof(struct vcache));
|
||||
}
|
||||
|
||||
void
|
||||
osi_AttachVnode(struct vcache *avc, int seq) {
|
||||
osi_AttachVnode(struct vcache *avc, int seq)
|
||||
{
|
||||
struct vnode *vp;
|
||||
|
||||
ReleaseWriteLock(&afs_xvcache);
|
||||
@ -117,7 +120,8 @@ osi_AttachVnode(struct vcache *avc, int seq) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
avc->v->v_mount = afs_globalVFS;
|
||||
vSetType(avc, VREG);
|
||||
}
|
||||
|
@ -14,7 +14,8 @@
|
||||
#include "afsincludes.h" /*AFS-based standard headers */
|
||||
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
int code;
|
||||
|
||||
/* we can't control whether we sleep */
|
||||
@ -28,23 +29,27 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
}
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
return afs_osi_Alloc(sizeof(struct vcache));
|
||||
}
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(avc, 0, sizeof(struct vcache));
|
||||
|
||||
avc->flushDV.low = avc->flushDV.high = AFS_MAXDV;
|
||||
}
|
||||
|
||||
void
|
||||
osi_AttachVnode(struct vcache *avc, int seq) {
|
||||
osi_AttachVnode(struct vcache *avc, int seq)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
AFSTOV(avc)->v_op = afs_ops;
|
||||
avc->v.v_vfsp = afs_globalVFS;
|
||||
vSetType(avc, VREG);
|
||||
|
@ -14,7 +14,8 @@
|
||||
#include "afsincludes.h" /*AFS-based standard headers */
|
||||
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
int code;
|
||||
/* we can't control whether we sleep */
|
||||
if (!VREFCOUNT_GT(avc,0)
|
||||
@ -29,7 +30,8 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
extern char *makesname();
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
struct vcache *avc;
|
||||
char name[METER_NAMSZ];
|
||||
|
||||
@ -47,16 +49,20 @@ osi_NewVnode(void) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
avc->uncred = 0;
|
||||
memset(&(avc->f), 0, sizeof(struct fvcache));
|
||||
}
|
||||
|
||||
void
|
||||
osi_AttachVnode(struct vcache *avc, int seq) { }
|
||||
osi_AttachVnode(struct vcache *avc, int seq)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(&(avc->vc_bhv_desc), 0, sizeof(avc->vc_bhv_desc));
|
||||
bhv_desc_init(&(avc->vc_bhv_desc), avc, avc, &Afs_vnodeops);
|
||||
|
||||
|
@ -25,7 +25,7 @@ TryEvictDirDentries(struct inode *inode)
|
||||
|
||||
afs_d_alias_lock(inode);
|
||||
|
||||
restart:
|
||||
restart:
|
||||
#if defined(D_ALIAS_IS_HLIST)
|
||||
# if defined(HLIST_ITERATOR_NO_NODE)
|
||||
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
|
||||
@ -88,7 +88,7 @@ restart:
|
||||
}
|
||||
afs_d_alias_unlock(inode);
|
||||
|
||||
inuse:
|
||||
inuse:
|
||||
return;
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ osi_ResetRootVCache(afs_uint32 volid)
|
||||
|
||||
AFS_RELE(root);
|
||||
afs_globalVp = vcp;
|
||||
out:
|
||||
out:
|
||||
crfree(credp);
|
||||
afs_DestroyReq(treq);
|
||||
}
|
||||
|
@ -14,7 +14,8 @@
|
||||
#include "afsincludes.h" /*AFS-based standard headers */
|
||||
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
*slept = 0;
|
||||
|
||||
if (!VREFCOUNT_GT(avc,0)
|
||||
@ -34,7 +35,8 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
}
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
struct vcache *tvc;
|
||||
|
||||
tvc = afs_osi_Alloc(sizeof(struct vcache));
|
||||
@ -47,12 +49,14 @@ osi_NewVnode(void) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(avc, 0, sizeof(struct vcache));
|
||||
}
|
||||
|
||||
void
|
||||
osi_AttachVnode(struct vcache *avc, int seq) {
|
||||
osi_AttachVnode(struct vcache *avc, int seq)
|
||||
{
|
||||
ReleaseWriteLock(&afs_xvcache);
|
||||
AFS_GUNLOCK();
|
||||
afs_obsd_getnewvnode(avc); /* includes one refcount */
|
||||
@ -62,7 +66,8 @@ osi_AttachVnode(struct vcache *avc, int seq) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
AFSTOV(avc)->v_mount = afs_globalVFS;
|
||||
vSetType(avc, VREG);
|
||||
}
|
||||
|
@ -14,7 +14,8 @@
|
||||
#include "afsincludes.h" /*AFS-based standard headers */
|
||||
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
int code;
|
||||
|
||||
if (!VREFCOUNT_GT(avc,0)
|
||||
@ -27,7 +28,8 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
}
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
struct vcache *avc;
|
||||
|
||||
avc = afs_osi_Alloc(sizeof(struct vcache));
|
||||
@ -38,7 +40,8 @@ osi_NewVnode(void) {
|
||||
}
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(avc, 0, sizeof(struct vcache));
|
||||
|
||||
QInit(&avc->multiPage);
|
||||
@ -80,7 +83,8 @@ osi_AttachVnode(struct vcache *avc, int seq)
|
||||
}
|
||||
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
AFSTOV(avc)->v_op = afs_ops;
|
||||
AFSTOV(avc)->v_vfsp = afs_globalVFS;
|
||||
vSetType(avc, VREG);
|
||||
|
@ -14,7 +14,8 @@
|
||||
#include "afsincludes.h" /*AFS-based standard headers */
|
||||
|
||||
int
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
|
||||
{
|
||||
int code;
|
||||
|
||||
if (!VREFCOUNT_GT(avc,0)
|
||||
@ -27,21 +28,26 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
|
||||
}
|
||||
|
||||
struct vcache *
|
||||
osi_NewVnode(void) {
|
||||
osi_NewVnode(void)
|
||||
{
|
||||
return afs_osi_Alloc(sizeof(struct vcache));
|
||||
}
|
||||
|
||||
void
|
||||
osi_PrePopulateVCache(struct vcache *avc) {
|
||||
osi_PrePopulateVCache(struct vcache *avc)
|
||||
{
|
||||
memset(avc, 0, sizeof(struct vcache));
|
||||
}
|
||||
|
||||
void
|
||||
osi_AttachVnode(struct vcache *avc, int seq) { }
|
||||
osi_AttachVnode(struct vcache *avc, int seq)
|
||||
{
|
||||
}
|
||||
|
||||
extern struct vnodeops *afs_ops;
|
||||
void
|
||||
osi_PostPopulateVCache(struct vcache *avc) {
|
||||
osi_PostPopulateVCache(struct vcache *avc)
|
||||
{
|
||||
AFSTOV(avc)->v_vfsp = afs_globalVFS;
|
||||
AFSTOV(avc)->v_op = afs_ops;
|
||||
vSetType(avc, VREG);
|
||||
|
Loading…
x
Reference in New Issue
Block a user