reindent-20030715
[openafs.git] / src / afs / VNOPS / afs_vnop_strategy.c
index 554f163..896add7 100644 (file)
 #include <afsconfig.h>
 #include "afs/param.h"
 
-RCSID("$Header$");
+RCSID
+    ("$Header$");
 
 #if !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afsincludes.h"       /* Afs-based standard headers */
-#include "afs/afs_stats.h" /* statistics */
+#include "afs/afs_stats.h"     /* statistics */
 #include "afs/afs_cbqueue.h"
 #include "afs/nfsclient.h"
 #include "afs/afs_osidnlc.h"
@@ -31,11 +32,12 @@ RCSID("$Header$");
 int
 #if    defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
 afs_ustrategy(abp, credp)
-    struct AFS_UCRED *credp;
+     struct AFS_UCRED *credp;
 #else
 afs_ustrategy(abp)
 #endif
-    register struct buf *abp; {
+     register struct buf *abp;
+{
     register afs_int32 code;
     struct uio tuio;
     register struct vcache *tvc = VTOAFS(abp->b_vp);
@@ -55,7 +57,7 @@ afs_ustrategy(abp)
      * So that it won't change while reading it
      */
     ObtainReadLock(&tvc->lock);
-    if (tvc->credp) {  
+    if (tvc->credp) {
        credp = tvc->credp;
        crhold(credp);
     } else {
@@ -70,10 +72,10 @@ afs_ustrategy(abp)
     if ((abp->b_flags & B_READ) == B_READ) {
 #endif
        /* read b_bcount bytes into kernel address b_un.b_addr starting
-           at byte DEV_BSIZE * b_blkno.  Bzero anything we can't read,
-           and finally call iodone(abp).  File is in abp->b_vp.  Credentials
-           are from u area??
-       */
+        * at byte DEV_BSIZE * b_blkno.  Bzero anything we can't read,
+        * and finally call iodone(abp).  File is in abp->b_vp.  Credentials
+        * are from u area??
+        */
        tuio.afsio_iov = tiovec;
        tuio.afsio_iovcnt = 1;
 #if    defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV)
@@ -100,7 +102,7 @@ afs_ustrategy(abp)
 #endif /* AFS_XBSD_ENV */
        tiovec[0].iov_len = abp->b_bcount;
        /* are user's credentials valid here?  probably, but this
-            sure seems like the wrong things to do. */
+        * sure seems like the wrong things to do. */
 #if    defined(AFS_SUN5_ENV)
        code = afs_nlrdwr(VTOAFS(abp->b_vp), &tuio, UIO_READ, 0, credp);
 #else
@@ -109,9 +111,11 @@ afs_ustrategy(abp)
        if (code == 0) {
            if (tuio.afsio_resid > 0)
 #if defined(AFS_XBSD_ENV)
-               memset(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid);
+               memset(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, 0,
+                      tuio.afsio_resid);
 #else
-               memset(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, 0, tuio.afsio_resid);
+               memset(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, 0,
+                      tuio.afsio_resid);
 #endif /* AFS_XBSD_ENV */
 #ifdef AFS_AIX32_ENV
            /*
@@ -122,15 +126,14 @@ afs_ustrategy(abp)
            if (dbtob(abp->b_blkno) + abp->b_bcount > tvc->m.Length) {
                if ((abp->b_flags & B_PFSTORE) == 0) {
                    AFS_GUNLOCK();
-                   vm_protectp(tvc->segid, dbtob(abp->b_blkno)/PAGESIZE,
-                               abp->b_bcount/PAGESIZE, RDONLY);
+                   vm_protectp(tvc->segid, dbtob(abp->b_blkno) / PAGESIZE,
+                               abp->b_bcount / PAGESIZE, RDONLY);
                    AFS_GLOCK();
                }
            }
 #endif
        }
-    }
-    else {
+    } else {
        tuio.afsio_iov = tiovec;
        tuio.afsio_iovcnt = 1;
 #if    defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
@@ -156,7 +159,7 @@ afs_ustrategy(abp)
 #ifdef AFS_UIOFMODE
        tuio.afsio_fmode = 0;
 #endif
-#ifdef AFS_AIX32_ENV   
+#ifdef AFS_AIX32_ENV
        /*
         * XXX It this really right? Ideally we should always write block size multiple
         * and not any arbitrary size, right? XXX
@@ -164,8 +167,10 @@ afs_ustrategy(abp)
        len = MIN(len, tvc->m.Length - dbtob(abp->b_blkno));
 #endif
 #ifdef AFS_ALPHA_ENV
-       len = MIN(abp->b_bcount, (VTOAFS(abp->b_vp))->m.Length - dbtob(abp->b_blkno));
-#endif /* AFS_ALPHA_ENV */
+       len =
+           MIN(abp->b_bcount,
+               (VTOAFS(abp->b_vp))->m.Length - dbtob(abp->b_blkno));
+#endif /* AFS_ALPHA_ENV */
        tuio.afsio_resid = len;
 #if defined(AFS_XBSD_ENV)
        tiovec[0].iov_base = abp->b_saveaddr;
@@ -174,7 +179,7 @@ afs_ustrategy(abp)
 #endif /* AFS_XBSD_ENV */
        tiovec[0].iov_len = len;
        /* are user's credentials valid here?  probably, but this
-            sure seems like the wrong things to do. */
+        * sure seems like the wrong things to do. */
 #if    defined(AFS_SUN5_ENV)
        code = afs_nlrdwr(VTOAFS(abp->b_vp), &tuio, UIO_WRITE, 0, credp);
 #else
@@ -193,12 +198,11 @@ afs_ustrategy(abp)
        /* prevent ubc from retrying writes */
        AFS_GUNLOCK();
        ubc_invalidate(AFSTOV(tvc)->v_object,
-                      (vm_offset_t)dbtob(abp->b_blkno),
-                      PAGE_SIZE, B_INVAL);
+                      (vm_offset_t) dbtob(abp->b_blkno), PAGE_SIZE, B_INVAL);
        AFS_GLOCK();
     }
 #endif
-#else  /* AFS_DUX40_ENV */
+#else /* AFS_DUX40_ENV */
     iodone(abp);
 #endif /* AFS_DUX40_ENV */
 #endif
@@ -206,8 +210,7 @@ afs_ustrategy(abp)
     crfree(credp);
 #endif
     afs_Trace3(afs_iclSetp, CM_TRACE_STRATEGYDONE, ICL_TYPE_POINTER, tvc,
-              ICL_TYPE_INT32, code,
-              ICL_TYPE_LONG, tuio.afsio_resid);
+              ICL_TYPE_INT32, code, ICL_TYPE_LONG, tuio.afsio_resid);
     return code;
 }