reindent-20030715
[openafs.git] / src / afs / HPUX / osi_vfsops.c
index 99ddfea..fc1eb5a 100644 (file)
 #include <afsconfig.h>
 #include "afs/param.h"
 
-RCSID("$Header$");
+RCSID
+    ("$Header$");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
-#include "afs/afs_stats.h"   /* statistics stuff */
+#include "afs/afs_stats.h"     /* statistics stuff */
 #include <sys/scall_kernprivate.h>
 
 
@@ -25,20 +26,21 @@ static char afs_mountpath[512];
 struct vfs *afs_globalVFS = 0;
 struct vcache *afs_globalVp = 0;
 
-int afs_mount(struct vfs *afsp, char *path, smountargs_t *data)
+int
+afs_mount(struct vfs *afsp, char *path, smountargs_t * data)
 {
     AFS_GLOCK();
     AFS_STATCNT(afs_mount);
 
-    if (afs_globalVFS) { /* Don't allow remounts. */
+    if (afs_globalVFS) {       /* Don't allow remounts. */
        AFS_GUNLOCK();
-       return (setuerror(EBUSY));
+       return (setuerror(EBUSY));
     }
 
     afs_globalVFS = afsp;
     afsp->vfs_bsize = 8192;
-    afsp->vfs_fsid[0] = AFS_VFSMAGIC; /* magic */
-    afsp->vfs_fsid[1] = AFS_VFSFSID; 
+    afsp->vfs_fsid[0] = AFS_VFSMAGIC;  /* magic */
+    afsp->vfs_fsid[1] = AFS_VFSFSID;
     strcpy(afsp->vfs_name, "AFS");
     afsp->vfs_name[3] = '\0';
 
@@ -47,7 +49,7 @@ int afs_mount(struct vfs *afsp, char *path, smountargs_t *data)
 
 #ifndef        AFS_NONFSTRANS
     /* Set up the xlator in case it wasn't done elsewhere */
-    afs_xlatorinit_v2(); 
+    afs_xlatorinit_v2();
 #endif
 
     AFS_GUNLOCK();
@@ -55,7 +57,8 @@ int afs_mount(struct vfs *afsp, char *path, smountargs_t *data)
 }
 
 
-int afs_unmount(struct vfs *afsp)
+int
+afs_unmount(struct vfs *afsp)
 {
     AFS_GLOCK();
     AFS_STATCNT(afs_unmount);
@@ -65,13 +68,14 @@ int afs_unmount(struct vfs *afsp)
 
     AFS_GUNLOCK();
     return 0;
-}      
+}
 
-int afs_root (struct vfs *afsp, struct vnode **avpp, char *unused1)
+int
+afs_root(struct vfs *afsp, struct vnode **avpp, char *unused1)
 {
     int code = 0;
     struct vrequest treq;
-    register struct vcache *tvp=0;
+    register struct vcache *tvp = 0;
     AFS_GLOCK();
     AFS_STATCNT(afs_root);
 
@@ -83,8 +87,8 @@ int afs_root (struct vfs *afsp, struct vnode **avpp, char *unused1)
            afs_globalVp = NULL;
        }
 
-       if (!(code = afs_InitReq(&treq,  p_cred(u.u_procp))) &&
-           !(code = afs_CheckInit())) {
+       if (!(code = afs_InitReq(&treq, p_cred(u.u_procp)))
+           && !(code = afs_CheckInit())) {
            tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
            /* we really want this to stay around */
            if (tvp) {
@@ -106,9 +110,10 @@ int afs_root (struct vfs *afsp, struct vnode **avpp, char *unused1)
 
     AFS_GUNLOCK();
     return code;
-}      
+}
 
-int afs_statfs(register struct vfs *afsp, struct k_statvfs *abp)
+int
+afs_statfs(register struct vfs *afsp, struct k_statvfs *abp)
 {
     AFS_GLOCK();
     AFS_STATCNT(afs_statfs);
@@ -126,25 +131,27 @@ int afs_statfs(register struct vfs *afsp, struct k_statvfs *abp)
 
     AFS_GUNLOCK();
     return 0;
-}      
+}
 
-int afs_sync(struct vfs *unused1, int unused2)
+int
+afs_sync(struct vfs *unused1, int unused2)
 {
     AFS_STATCNT(afs_sync);
     return 0;
 }
 
-int afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp)
+int
+afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp)
 {
     int code;
     struct vrequest treq;
     AFS_GLOCK();
     AFS_STATCNT(afs_vget);
 
-    * avcp = NULL;
+    *avcp = NULL;
 
-    if ((code = afs_InitReq(&treq, p_cred(u.u_procp)))==0) {
-       code = afs_osi_vget((struct vcache**)avcp, fidp, &treq);
+    if ((code = afs_InitReq(&treq, p_cred(u.u_procp))) == 0) {
+       code = afs_osi_vget((struct vcache **)avcp, fidp, &treq);
     }
 
     afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp,
@@ -153,16 +160,19 @@ int afs_vget(struct vfs *afsp, struct vnode **avcp, struct fid *fidp)
 
     AFS_GUNLOCK();
     return code;
-}      
+}
 
-int afs_getmount(struct vfs *vfsp, char *fsmntdir, struct mount_data *mdp, char *unused1)
+int
+afs_getmount(struct vfs *vfsp, char *fsmntdir, struct mount_data *mdp,
+            char *unused1)
 {
     int l;
 
     mdp->md_msite = 0;
     mdp->md_dev = 0;
     mdp->md_rdev = 0;
-    return(copyoutstr(afs_mountpath, fsmntdir, strlen(afs_mountpath)+1, &l));
+    return (copyoutstr
+           (afs_mountpath, fsmntdir, strlen(afs_mountpath) + 1, &l));
 }
 
 
@@ -174,13 +184,13 @@ struct vfsops Afs_vfsops = {
     afs_sync,
     afs_vget,
     afs_getmount,
-    (vfs_freeze_t *)0, /* vfs_freeze */
-    (vfs_thaw_t *)0,   /* vfs_thaw */
-    (vfs_quota_t *)0,  /* vfs_quota */
-    (vfs_mountroot_t *)0,              /* vfs_mountroot. Note: afs_mountroot_nullop in this
-                         *                position panicked HP 11.00+
-                         */
-    (vfs_size_t *)0    /* vfs_size */
+    (vfs_freeze_t *) 0,                /* vfs_freeze */
+    (vfs_thaw_t *) 0,          /* vfs_thaw */
+    (vfs_quota_t *) 0,         /* vfs_quota */
+    (vfs_mountroot_t *) 0,     /* vfs_mountroot. Note: afs_mountroot_nullop in this
+                                *                position panicked HP 11.00+
+                                */
+    (vfs_size_t *) 0           /* vfs_size */
 };
 
 static int afs_Starting = 0;
@@ -188,15 +198,15 @@ static int afs_Starting = 0;
 #pragma align 64
 #if !defined(AFS_HPUX110_ENV)
 sema_t afs_global_sema = {
-   NULL, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, /* sa_type */
-   0, 0, 0, 0, 0, 0, 0, NULL, /* sa_link */
-   NULL, NULL
+    NULL, 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0,      /* sa_type */
+    0, 0, 0, 0, 0, 0, 0, NULL, /* sa_link */
+    NULL, NULL
 #ifdef SEMA_COUNTING
-   , 0, 0, 0, NULL
+       , 0, 0, 0, NULL
 #endif
-  };
+};
 #else
-b_sema_t afs_global_sema = {0}; 
+b_sema_t afs_global_sema = { 0 };
 #endif
 
 void
@@ -205,15 +215,15 @@ osi_InitGlock()
     register ulong_t context;
 
     SPINLOCK_USAV(sched_lock, context);
-    if ( !afs_Starting ) {
+    if (!afs_Starting) {
        afs_Starting = 1;
        SPINUNLOCK_USAV(sched_lock, context);
 #if defined(AFS_HPUX110_ENV)
-       b_initsema(&afs_global_sema, 1,  NFS_LOCK_ORDER2, "AFS GLOCK");
-        /* afsHash(64); */     /* 64 buckets */
+       b_initsema(&afs_global_sema, 1, NFS_LOCK_ORDER2, "AFS GLOCK");
+       /* afsHash(64); *//* 64 buckets */
 #else
-    initsema(&afs_global_sema, 1, FILESYS_SEMA_PRI, FILESYS_SEMA_ORDER);
-          afsHash(64);  /* 64 buckets */
+       initsema(&afs_global_sema, 1, FILESYS_SEMA_PRI, FILESYS_SEMA_ORDER);
+       afsHash(64);            /* 64 buckets */
 #endif
     } else {
        SPINUNLOCK_USAV(sched_lock, context);
@@ -226,7 +236,7 @@ osi_InitGlock()
 /*
  * afsc_link - Initialize VFS
  */
-int afs_vfs_slot=-1; 
+int afs_vfs_slot = -1;
 
 
 afsc_link()
@@ -235,10 +245,11 @@ afsc_link()
 
     /* For now nothing special is required during AFS initialization. */
     AFS_STATCNT(afsc_link);
-    osi_Init();                
-    if ( (afs_vfs_slot=add_vfs_type("afs", &Afs_vfsops)) < 0 )
+    osi_Init();
+    if ((afs_vfs_slot = add_vfs_type("afs", &Afs_vfsops)) < 0)
        return;
-    sysent_assign_function(AFS_SYSCALL, 7, (void (*)())Afs_syscall, "Afs_syscall");
+    sysent_assign_function(AFS_SYSCALL, 7, (void (*)())Afs_syscall,
+                          "Afs_syscall");
     sysent_define_arg(AFS_SYSCALL, 0, longArg);
     sysent_define_arg(AFS_SYSCALL, 1, longArg);
     sysent_define_arg(AFS_SYSCALL, 2, longArg);
@@ -255,4 +266,3 @@ afsc_link()
     sysent_returns_long(80);
     return 0;
 }
-