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.
Change-Id: I0cee370e25d10b1ca4627832097a9a9f1e83b4c2
Reviewed-on: http://gerrit.openafs.org/4748
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
* 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};
* 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;
* 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;
/* 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
/* 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 */
{
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);
{
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);
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,
kunmap(pp);
- osi_Free(auio, sizeof(uio_t));
+ osi_Free(auio, sizeof(struct uio));
osi_Free(iovecp, sizeof(struct iovec));
crfree(credp);
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;
/* 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;
/* 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
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;
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 */
char *buffer;
afs_offs_t base;
int code = 0;
- uio_t tuio;
+ struct uio tuio;
struct iovec iovec;
int f_flags = 0;
* 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;
* 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;
* 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;
/* 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
/* 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 */
{
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);
#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);
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,
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) {
afs_offs_t base;
int code = 0;
cred_t *credp;
- uio_t tuio;
+ struct uio tuio;
struct iovec iovec;
int f_flags = 0;
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);
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)
{
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;
}
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;
osi_Free(tcallspec, sizeof(struct tlocal1));
osi_Free(iovecp, auio->uio_iovcnt * sizeof(struct iovec));
osi_Free(bparms, sizeof(struct nocache_read_request));
- osi_Free(auio, sizeof(uio_t));
+ osi_Free(auio, sizeof(struct uio));
return code;
}
#define AFS_CACHE_BYPASS_DISABLED -1
#ifdef UKERNEL
-typedef struct uio uio_t;
#ifndef PAGE_SIZE
#define PAGE_SIZE 1024 * sizeof(long) / 8
#endif
int32 length;
#elif defined(AFS_LINUX24_ENV) || defined(AFS_USR_LINUX24_ENV)
/* 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;
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);