]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Tidy up uio_t meaning
authorSimon Wilkinson <sxw@your-file-system.com>
Sun, 17 Apr 2011 20:30:39 +0000 (21:30 +0100)
committerDerrick Brashear <shadow@dementix.org>
Wed, 2 Nov 2011 02:25:50 +0000 (19:25 -0700)
On IRIX, uio_t is typedef'd to "struct uio".
On Darwin, uio_t is typedef'd to "struct uio *".

Reduce the confusion by just not using "uio_t" in places where it
isn't being defined for us, and avoiding it completely in cross-platform
code.

Reviewed-on: http://gerrit.openafs.org/4748
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ca465e432d67b067fc3854781b8702aaff577cc7)

Change-Id: Id37d11e72d196f5008e9843d4f04c492a4017e72
Reviewed-on: http://gerrit.openafs.org/5779
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_machdep.h
src/afs/LINUX/osi_prototypes.h
src/afs/LINUX/osi_vnodeops.c
src/afs/LINUX24/osi_file.c
src/afs/LINUX24/osi_machdep.h
src/afs/LINUX24/osi_prototypes.h
src/afs/LINUX24/osi_vnodeops.c
src/afs/afs_bypasscache.c
src/afs/afs_bypasscache.h
src/afs/afs_prototypes.h

index fbd20e9a02e9dc9b36947f93f5d445f933aa85df..3c20fd9f80c3157a953b34e54e3e50960ad2e9a0 100644 (file)
@@ -333,7 +333,7 @@ osi_InitCacheInfo(char *aname)
  * kernel space.
  */
 int
-osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
+osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw)
 {
     struct file *filp = osifile->filp;
     mm_segment_t old_fs = {0};
@@ -401,7 +401,7 @@ osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
  * Setup a uio struct.
  */
 void
-setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
+setup_uio(struct uio *uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
          int count, uio_flag_t flag, uio_seg_t seg)
 {
     iovecp->iov_base = (char *)buf;
@@ -420,7 +420,7 @@ setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
  * UIO_WRITE : uio -> dp
  */
 int
-uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop)
+uiomove(char *dp, int length, uio_flag_t rw, struct uio *uiop)
 {
     int count;
     struct iovec *iov;
index 6c9390ba6ebc861c5c51d91dd2328703e7752051..a2c16f5061cd24ca70fd7b7f6c96592171f32780 100644 (file)
@@ -224,14 +224,14 @@ afs_set_cr_group_info(cred_t *cred, struct group_info *group_info) {
 /* UIO manipulation */
 typedef enum { AFS_UIOSYS, AFS_UIOUSER } uio_seg_t;
 typedef enum { UIO_READ, UIO_WRITE } uio_flag_t;
-typedef struct uio {
+struct uio {
     struct iovec *uio_iov;
     int uio_iovcnt;
     afs_offs_t uio_offset;
     uio_seg_t uio_seg;
     int uio_resid;
     uio_flag_t uio_flag;
-} uio_t;
+};
 #define        afsio_iov       uio_iov
 #define        afsio_iovcnt    uio_iovcnt
 #define        afsio_offset    uio_offset
index 25204ecd236f443b2ccaa703ce1dc5a9a2e31a6f..900288289c4ce45eeaff89919f878580775eaa5a 100644 (file)
@@ -37,7 +37,7 @@ 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, uio_t * uiop, int rw);
+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);
 
 /* osi_ioctl.c */
index 4c4009434ce2e3ac8203cb57048265ef47cf634f..e9215dbef5f8b1f416e69b686c8104cbb8f70595 100644 (file)
@@ -1336,7 +1336,7 @@ afs_linux_ireadlink(struct inode *ip, char *target, int maxlen, uio_seg_t seg)
 {
     int code;
     cred_t *credp = crref();
-    uio_t tuio;
+    struct uio tuio;
     struct iovec iov;
 
     setup_uio(&tuio, &iov, target, (afs_offs_t) 0, maxlen, UIO_READ, seg);
@@ -1620,7 +1620,7 @@ afs_linux_fillpage(struct file *fp, struct page *pp)
 {
     afs_int32 code;
     char *address;
-    uio_t *auio;
+    struct uio *auio;
     struct iovec *iovecp;
     struct inode *ip = FILE_INODE(fp);
     afs_int32 cnt = page_count(pp);
@@ -1639,7 +1639,7 @@ afs_linux_fillpage(struct file *fp, struct page *pp)
     address = kmap(pp);
     ClearPageError(pp);
 
-    auio = osi_Alloc(sizeof(uio_t));
+    auio = osi_Alloc(sizeof(struct uio));
     iovecp = osi_Alloc(sizeof(struct iovec));
 
     setup_uio(auio, iovecp, (char *)address, offset, PAGE_SIZE, UIO_READ,
@@ -1671,7 +1671,7 @@ afs_linux_fillpage(struct file *fp, struct page *pp)
 
     kunmap(pp);
 
-    osi_Free(auio, sizeof(uio_t));
+    osi_Free(auio, sizeof(struct uio));
     osi_Free(iovecp, sizeof(struct iovec));
 
     crfree(credp);
@@ -1714,7 +1714,7 @@ afs_linux_bypass_readpages(struct file *fp, struct address_space *mapping,
                           struct list_head *page_list, unsigned num_pages)
 {
     afs_int32 page_ix;
-    uio_t *auio;
+    struct uio *auio;
     afs_offs_t offset;
     struct iovec* iovecp;
     struct nocache_read_request *ancr;
@@ -1732,7 +1732,7 @@ afs_linux_bypass_readpages(struct file *fp, struct address_space *mapping,
     /* background thread must free: iovecp, auio, ancr */
     iovecp = osi_Alloc(num_pages * sizeof(struct iovec));
 
-    auio = osi_Alloc(sizeof(uio_t));
+    auio = osi_Alloc(sizeof(struct uio));
     auio->uio_iov = iovecp;
     auio->uio_iovcnt = num_pages;
     auio->uio_flag = UIO_READ;
@@ -1818,7 +1818,7 @@ afs_linux_bypass_readpages(struct file *fp, struct address_space *mapping,
         /* If there is nothing for the background thread to handle,
          * it won't be freeing the things that we never gave it */
         osi_Free(iovecp, num_pages * sizeof(struct iovec));
-        osi_Free(auio, sizeof(uio_t));
+        osi_Free(auio, sizeof(struct uio));
         osi_Free(ancr, sizeof(struct nocache_read_request));
     }
     /* we do not flush, release, or unmap pages--that will be
@@ -1832,7 +1832,7 @@ static int
 afs_linux_bypass_readpage(struct file *fp, struct page *pp)
 {
     cred_t *credp = NULL;
-    uio_t *auio;
+    struct uio *auio;
     struct iovec *iovecp;
     struct nocache_read_request *ancr;
     int code;
@@ -1851,7 +1851,7 @@ afs_linux_bypass_readpage(struct file *fp, struct page *pp)
     ClearPageError(pp);
 
     /* receiver frees */
-    auio = osi_Alloc(sizeof(uio_t));
+    auio = osi_Alloc(sizeof(struct uio));
     iovecp = osi_Alloc(sizeof(struct iovec));
 
     /* address can be NULL, because we overwrite it with 'pp', below */
@@ -2058,7 +2058,7 @@ afs_linux_page_writeback(struct inode *ip, struct page *pp,
     char *buffer;
     afs_offs_t base;
     int code = 0;
-    uio_t tuio;
+    struct uio tuio;
     struct iovec iovec;
     int f_flags = 0;
 
index 98f931edc3460309a37a83e0fd9aeca73087488b..875138808eae8113d28f7db1273baae697280610 100644 (file)
@@ -318,7 +318,7 @@ osi_InitCacheInfo(char *aname)
  * kernel space.
  */
 int
-osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
+osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw)
 {
     struct file *filp = &osifile->file;
     KERNEL_SPACE_DECL;
@@ -386,7 +386,7 @@ osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
  * Setup a uio struct.
  */
 void
-setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
+setup_uio(struct uio *uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
          int count, uio_flag_t flag, uio_seg_t seg)
 {
     iovecp->iov_base = (char *)buf;
@@ -405,7 +405,7 @@ setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf, afs_offs_t pos,
  * UIO_WRITE : uio -> dp
  */
 int
-uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop)
+uiomove(char *dp, int length, uio_flag_t rw, struct uio *uiop)
 {
     int count;
     struct iovec *iov;
index 1aacbf66c1f5dc65fcb1df5643c38416861700e8..d37117622156982209c66d09537acfbec2bca3ac 100644 (file)
@@ -197,14 +197,14 @@ typedef struct task_struct afs_proc_t;
 /* UIO manipulation */
 typedef enum { AFS_UIOSYS, AFS_UIOUSER } uio_seg_t;
 typedef enum { UIO_READ, UIO_WRITE } uio_flag_t;
-typedef struct uio {
+struct uio {
     struct iovec *uio_iov;
     int uio_iovcnt;
     afs_offs_t uio_offset;
     uio_seg_t uio_seg;
     int uio_resid;
     uio_flag_t uio_flag;
-} uio_t;
+};
 #define        afsio_iov       uio_iov
 #define        afsio_iovcnt    uio_iovcnt
 #define        afsio_offset    uio_offset
index 5a1e59e92b6f0bd377d9c44f3d111e9d1414195c..ad2522cacd75c6e5479b1c0ca953428711364006 100644 (file)
@@ -37,7 +37,7 @@ 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, uio_t * uiop, int rw);
+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, ino_t *hint);
 
 /* osi_ioctl.c */
index b0956e5dffd5a009f37bdbf850a1b65c8209524f..b5b0256339d3a86cf97e81495859357358901046 100644 (file)
@@ -1408,7 +1408,7 @@ afs_linux_ireadlink(struct inode *ip, char *target, int maxlen, uio_seg_t seg)
 {
     int code;
     cred_t *credp = crref();
-    uio_t tuio;
+    struct uio tuio;
     struct iovec iov;
 
     setup_uio(&tuio, &iov, target, (afs_offs_t) 0, maxlen, UIO_READ, seg);
@@ -1544,7 +1544,7 @@ afs_linux_readpage(struct file *fp, struct page *pp)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     afs_int32 isize;
 #endif
-    uio_t *auio;
+    struct uio *auio;
     struct iovec *iovecp;
     struct inode *ip = FILE_INODE(fp);
     afs_int32 cnt = page_count(pp);
@@ -1561,7 +1561,7 @@ afs_linux_readpage(struct file *fp, struct page *pp)
     clear_bit(PG_error, &pp->flags);
 #endif
     /* if bypasscache, receiver frees, else we do */
-    auio = osi_Alloc(sizeof(uio_t));
+    auio = osi_Alloc(sizeof(struct uio));
     iovecp = osi_Alloc(sizeof(struct iovec));
 
     setup_uio(auio, iovecp, (char *)address, offset, PAGE_SIZE, UIO_READ,
@@ -1639,7 +1639,7 @@ afs_linux_readpage(struct file *fp, struct page *pp)
        goto done;
 
     /* free if not bypassing cache */
-    osi_Free(auio, sizeof(uio_t));
+    osi_Free(auio, sizeof(struct uio));
     osi_Free(iovecp, sizeof(struct iovec));
 
     if (!code && AFS_CHUNKOFFSET(offset) == 0) {
@@ -1675,7 +1675,7 @@ afs_linux_writepage_sync(struct inode *ip, struct page *pp,
     afs_offs_t base;
     int code = 0;
     cred_t *credp;
-    uio_t tuio;
+    struct uio tuio;
     struct iovec iovec;
     int f_flags = 0;
 
@@ -1785,7 +1785,7 @@ afs_linux_updatepage(struct file *fp, struct page *pp, unsigned long offset,
     u8 *page_addr = (u8 *) afs_linux_page_address(pp);
     int code = 0;
     cred_t *credp;
-    uio_t tuio;
+    struct uio tuio;
     struct iovec iovec;
 
     set_bit(PG_locked, &pp->flags);
index 8fe54207b23f244f6b34e42e8adea35027cf4d93..945d9b8b2ad1101e3fe234879638f48df12b6cd7 100644 (file)
@@ -354,7 +354,7 @@ typedef struct page * bypass_page_t;
 static afs_int32
 afs_NoCacheFetchProc(struct rx_call *acall,
                      struct vcache *avc,
-                                        uio_t *auio,
+                    struct uio *auio,
                      afs_int32 release_pages,
                     afs_int32 size)
 {
@@ -544,7 +544,7 @@ cleanup:
     osi_Free(areq, sizeof(struct vrequest));
     osi_Free(bparms->auio->uio_iov,
             bparms->auio->uio_iovcnt * sizeof(struct iovec));
-    osi_Free(bparms->auio, sizeof(uio_t));
+    osi_Free(bparms->auio, sizeof(struct uio));
     osi_Free(bparms, sizeof(struct nocache_read_request));
     return code;
 }
@@ -556,7 +556,7 @@ afs_PrefetchNoCache(struct vcache *avc,
                    afs_ucred_t *acred,
                    struct nocache_read_request *bparms)
 {
-    uio_t *auio;
+    struct uio *auio;
     struct iovec *iovecp;
     struct vrequest *areq;
     afs_int32 code = 0;
@@ -669,7 +669,7 @@ done:
 #ifndef UKERNEL
     /* in UKERNEL, the "pages" are passed in */
     osi_Free(iovecp, auio->uio_iovcnt * sizeof(struct iovec));
-    osi_Free(auio, sizeof(uio_t));
+    osi_Free(auio, sizeof(struct uio));
 #endif
     return code;
 }
index cb5e664e05e51f233e9fcdbbd4c37da77926a57b..2a86eac7ff60f2d10355f30bab68224e9b542f3e 100644 (file)
@@ -70,9 +70,6 @@
 #define AFS_CACHE_BYPASS_DISABLED -1
 
 #ifdef UKERNEL
-#ifdef AFS_USR_LINUX24_ENV
-typedef struct uio uio_t;
-#endif
 #ifndef PAGE_CACHE_SIZE
 #define PAGE_CACHE_SIZE 4096
 #endif
@@ -89,7 +86,7 @@ struct nocache_read_request {
     caddr_t address;
 #elif defined(AFS_LINUX24_ENV) || defined(UKERNEL)
     /* The tested platform, as CITI impl. just packs ab->parms */
-    uio_t * auio;
+    struct uio *auio;
     struct vrequest *areq;
     afs_size_t offset;
     afs_size_t length;
index 28e2010421581d752951b48d7d7e20390465acab..10ba037bf55c2082fe13c2a632015c8a06ff89d4 100644 (file)
@@ -635,11 +635,11 @@ extern void afs_osi_SetTime(osi_timeval_t * atv);
 extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
                          struct dentry **dpp);
 extern int osi_InitCacheInfo(char *aname);
-extern int osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw);
-extern void setup_uio(uio_t * uiop, struct iovec *iovecp, const char *buf,
+extern int osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw);
+extern void setup_uio(struct uio *uiop, struct iovec *iovecp, const char *buf,
                      afs_offs_t pos, int count, uio_flag_t flag,
                      uio_seg_t seg);
-extern int uiomove(char *dp, int length, uio_flag_t rw, uio_t * uiop);
+extern int uiomove(char *dp, int length, uio_flag_t rw, struct uio *uiop);
 extern void osi_linux_free_inode_pages(void);
 #endif
 extern void osi_linux_mask(void);