Commit dcf9867e authored by Nathan Scott's avatar Nathan Scott Committed by Nathan Scott

[XFS] sparse: annotate source for user pointers. From Chris Wedgwood.

SGI Modid: xfs-linux:xfs-kern:174337a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 6a3eaa1e
...@@ -95,7 +95,7 @@ extern int xfs_acl_vremove(struct vnode *vp, int); ...@@ -95,7 +95,7 @@ extern int xfs_acl_vremove(struct vnode *vp, int);
#define _ACL_XFS_IACCESS(i,m,c) (XFS_IFORK_Q(i) ? xfs_acl_iaccess(i,m,c) : -1) #define _ACL_XFS_IACCESS(i,m,c) (XFS_IFORK_Q(i) ? xfs_acl_iaccess(i,m,c) : -1)
#define _ACL_ALLOC(a) ((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP)) #define _ACL_ALLOC(a) ((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP))
#define _ACL_FREE(a) ((a)? kmem_zone_free(xfs_acl_zone, (a)) : 0) #define _ACL_FREE(a) ((a)? kmem_zone_free(xfs_acl_zone, (a)):(void)0)
#else #else
#define xfs_acl_zone_init(zone,name) #define xfs_acl_zone_init(zone,name)
......
...@@ -5478,7 +5478,7 @@ int /* error code */ ...@@ -5478,7 +5478,7 @@ int /* error code */
xfs_getbmap( xfs_getbmap(
bhv_desc_t *bdp, /* XFS behavior descriptor*/ bhv_desc_t *bdp, /* XFS behavior descriptor*/
struct getbmap *bmv, /* user bmap structure */ struct getbmap *bmv, /* user bmap structure */
void *ap, /* pointer to user's array */ void __user *ap, /* pointer to user's array */
int interface) /* interface flags */ int interface) /* interface flags */
{ {
__int64_t bmvend; /* last block requested */ __int64_t bmvend; /* last block requested */
...@@ -5667,8 +5667,8 @@ xfs_getbmap( ...@@ -5667,8 +5667,8 @@ xfs_getbmap(
(__int64_t)(bmvend - bmv->bmv_offset)); (__int64_t)(bmvend - bmv->bmv_offset));
bmv->bmv_entries++; bmv->bmv_entries++;
ap = (interface & BMV_IF_EXTENDED) ? ap = (interface & BMV_IF_EXTENDED) ?
(void *)((struct getbmapx *)ap + 1) : (void __user *)((struct getbmapx __user *)ap + 1) :
(void *)((struct getbmap *)ap + 1); (void __user *)((struct getbmap __user *)ap + 1);
} }
} }
} while (nmap && nexleft && bmv->bmv_length); } while (nmap && nexleft && bmv->bmv_length);
......
...@@ -328,7 +328,7 @@ int /* error code */ ...@@ -328,7 +328,7 @@ int /* error code */
xfs_getbmap( xfs_getbmap(
bhv_desc_t *bdp, /* XFS behavior descriptor*/ bhv_desc_t *bdp, /* XFS behavior descriptor*/
struct getbmap *bmv, /* user bmap structure */ struct getbmap *bmv, /* user bmap structure */
void *ap, /* pointer to user's array */ void __user *ap, /* pointer to user's array */
int iflags); /* interface flags */ int iflags); /* interface flags */
/* /*
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
*/ */
int int
xfs_swapext( xfs_swapext(
xfs_swapext_t *sxp) xfs_swapext_t __user *sxp)
{ {
xfs_swapext_t sx; xfs_swapext_t sx;
xfs_inode_t *ip=NULL, *tip=NULL, *ips[2]; xfs_inode_t *ip=NULL, *tip=NULL, *ips[2];
......
...@@ -60,7 +60,7 @@ typedef struct xfs_swapext ...@@ -60,7 +60,7 @@ typedef struct xfs_swapext
/* /*
* Syscall interface for xfs_swapext * Syscall interface for xfs_swapext
*/ */
int xfs_swapext(struct xfs_swapext *sx); int xfs_swapext(struct xfs_swapext __user *sx);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -313,10 +313,10 @@ typedef struct xfs_bstat { ...@@ -313,10 +313,10 @@ typedef struct xfs_bstat {
* The user-level BulkStat Request interface structure. * The user-level BulkStat Request interface structure.
*/ */
typedef struct xfs_fsop_bulkreq { typedef struct xfs_fsop_bulkreq {
__u64 *lastip; /* last inode # pointer */ __u64 __user *lastip; /* last inode # pointer */
__s32 icount; /* count of entries in buffer */ __s32 icount; /* count of entries in buffer */
void *ubuffer; /* user buffer for inode desc. */ void __user *ubuffer; /* user buffer for inode desc. */
__s32 *ocount; /* output count pointer */ __s32 __user *ocount; /* output count pointer */
} xfs_fsop_bulkreq_t; } xfs_fsop_bulkreq_t;
...@@ -344,12 +344,12 @@ typedef struct xfs_error_injection { ...@@ -344,12 +344,12 @@ typedef struct xfs_error_injection {
*/ */
typedef struct xfs_fsop_handlereq { typedef struct xfs_fsop_handlereq {
__u32 fd; /* fd for FD_TO_HANDLE */ __u32 fd; /* fd for FD_TO_HANDLE */
void *path; /* user pathname */ void __user *path; /* user pathname */
__u32 oflags; /* open flags */ __u32 oflags; /* open flags */
void *ihandle; /* user supplied handle */ void __user *ihandle; /* user supplied handle */
__u32 ihandlen; /* user supplied length */ __u32 ihandlen; /* user supplied length */
void *ohandle; /* user buffer for handle */ void __user *ohandle; /* user buffer for handle */
__u32 *ohandlen; /* user buffer length */ __u32 __user *ohandlen; /* user buffer length */
} xfs_fsop_handlereq_t; } xfs_fsop_handlereq_t;
/* /*
...@@ -361,7 +361,7 @@ typedef struct xfs_fsop_handlereq { ...@@ -361,7 +361,7 @@ typedef struct xfs_fsop_handlereq {
typedef struct xfs_fsop_setdm_handlereq { typedef struct xfs_fsop_setdm_handlereq {
struct xfs_fsop_handlereq hreq; /* handle interface structure */ struct xfs_fsop_handlereq hreq; /* handle interface structure */
struct fsdmidata *data; /* DMAPI data to set */ struct fsdmidata __user *data; /* DMAPI data to set */
} xfs_fsop_setdm_handlereq_t; } xfs_fsop_setdm_handlereq_t;
typedef struct xfs_attrlist_cursor { typedef struct xfs_attrlist_cursor {
...@@ -388,7 +388,7 @@ typedef struct xfs_attr_multiop { ...@@ -388,7 +388,7 @@ typedef struct xfs_attr_multiop {
typedef struct xfs_fsop_attrmulti_handlereq { typedef struct xfs_fsop_attrmulti_handlereq {
struct xfs_fsop_handlereq hreq; /* handle interface structure */ struct xfs_fsop_handlereq hreq; /* handle interface structure */
__u32 opcount; /* count of following multiop */ __u32 opcount; /* count of following multiop */
struct xfs_attr_multiop *ops; /* attr_multi data to get/set */ struct xfs_attr_multiop __user *ops; /* attr_multi data to get/set */
} xfs_fsop_attrmulti_handlereq_t; } xfs_fsop_attrmulti_handlereq_t;
/* /*
......
...@@ -68,7 +68,7 @@ int /* error status */ ...@@ -68,7 +68,7 @@ int /* error status */
xfs_bulkstat_one( xfs_bulkstat_one(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_ino_t ino, /* inode number to get data for */ xfs_ino_t ino, /* inode number to get data for */
void *buffer, /* buffer to place output in */ char __user *buffer, /* buffer to place output in */
int ubsize, /* size of buffer */ int ubsize, /* size of buffer */
void *private_data, /* my private data */ void *private_data, /* my private data */
xfs_daddr_t bno, /* starting bno of inode cluster */ xfs_daddr_t bno, /* starting bno of inode cluster */
...@@ -231,7 +231,7 @@ xfs_bulkstat( ...@@ -231,7 +231,7 @@ xfs_bulkstat(
bulkstat_one_pf formatter, /* func that'd fill a single buf */ bulkstat_one_pf formatter, /* func that'd fill a single buf */
void *private_data,/* private data for formatter */ void *private_data,/* private data for formatter */
size_t statstruct_size, /* sizeof struct filling */ size_t statstruct_size, /* sizeof struct filling */
xfs_caddr_t ubuffer, /* buffer with inode stats */ char __user *ubuffer, /* buffer with inode stats */
int flags, /* defined in xfs_itable.h */ int flags, /* defined in xfs_itable.h */
int *done) /* 1 if there're more stats to get */ int *done) /* 1 if there're more stats to get */
{ {
...@@ -265,7 +265,7 @@ xfs_bulkstat( ...@@ -265,7 +265,7 @@ xfs_bulkstat(
int tmp; /* result value from btree calls */ int tmp; /* result value from btree calls */
int ubcount; /* size of user's buffer */ int ubcount; /* size of user's buffer */
int ubleft; /* bytes left in user's buffer */ int ubleft; /* bytes left in user's buffer */
xfs_caddr_t ubufp; /* current pointer into user's buffer */ char __user *ubufp; /* current pointer into user's buffer */
int ubelem; /* spaces used in user's buffer */ int ubelem; /* spaces used in user's buffer */
int ubused; /* bytes used by formatter */ int ubused; /* bytes used by formatter */
xfs_buf_t *bp; /* ptr to on-disk inode cluster buf */ xfs_buf_t *bp; /* ptr to on-disk inode cluster buf */
...@@ -633,7 +633,7 @@ int /* error status */ ...@@ -633,7 +633,7 @@ int /* error status */
xfs_bulkstat_single( xfs_bulkstat_single(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_ino_t *lastinop, /* inode to return */ xfs_ino_t *lastinop, /* inode to return */
xfs_caddr_t buffer, /* buffer with inode stats */ char __user *buffer,/* buffer with inode stats */
int *done) /* 1 if there're more stats to get */ int *done) /* 1 if there're more stats to get */
{ {
int count; /* count value for bulkstat call */ int count; /* count value for bulkstat call */
...@@ -682,7 +682,7 @@ xfs_inumbers( ...@@ -682,7 +682,7 @@ xfs_inumbers(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_ino_t *lastino, /* last inode returned */ xfs_ino_t *lastino, /* last inode returned */
int *count, /* size of buffer/count returned */ int *count, /* size of buffer/count returned */
xfs_caddr_t ubuffer) /* buffer with inode descriptions */ xfs_inogrp_t __user *ubuffer) /* buffer with inode descriptions */
{ {
xfs_buf_t *agbp; xfs_buf_t *agbp;
xfs_agino_t agino; xfs_agino_t agino;
...@@ -766,7 +766,7 @@ xfs_inumbers( ...@@ -766,7 +766,7 @@ xfs_inumbers(
error = XFS_ERROR(EFAULT); error = XFS_ERROR(EFAULT);
break; break;
} }
ubuffer += bufidx * sizeof(*buffer); ubuffer += bufidx;
*count += bufidx; *count += bufidx;
bufidx = 0; bufidx = 0;
} }
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
*/ */
typedef int (*bulkstat_one_pf)(struct xfs_mount *mp, typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
xfs_ino_t ino, xfs_ino_t ino,
void *buffer, char __user *buffer,
int ubsize, int ubsize,
void *private_data, void *private_data,
xfs_daddr_t bno, xfs_daddr_t bno,
...@@ -73,7 +73,7 @@ xfs_bulkstat( ...@@ -73,7 +73,7 @@ xfs_bulkstat(
bulkstat_one_pf formatter, /* func that'd fill a single buf */ bulkstat_one_pf formatter, /* func that'd fill a single buf */
void *private_data, /* private data for formatter */ void *private_data, /* private data for formatter */
size_t statstruct_size,/* sizeof struct that we're filling */ size_t statstruct_size,/* sizeof struct that we're filling */
xfs_caddr_t ubuffer, /* buffer with inode stats */ char __user *ubuffer, /* buffer with inode stats */
int flags, /* flag to control access method */ int flags, /* flag to control access method */
int *done); /* 1 if there're more stats to get */ int *done); /* 1 if there're more stats to get */
...@@ -81,14 +81,14 @@ int ...@@ -81,14 +81,14 @@ int
xfs_bulkstat_single( xfs_bulkstat_single(
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_ino_t *lastinop, xfs_ino_t *lastinop,
xfs_caddr_t buffer, char __user *buffer,
int *done); int *done);
int int
xfs_bulkstat_one( xfs_bulkstat_one(
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_ino_t ino, xfs_ino_t ino,
void *buffer, char __user *buffer,
int ubsize, int ubsize,
void *private_data, void *private_data,
xfs_daddr_t bno, xfs_daddr_t bno,
...@@ -101,6 +101,6 @@ xfs_inumbers( ...@@ -101,6 +101,6 @@ xfs_inumbers(
xfs_mount_t *mp, /* mount point for filesystem */ xfs_mount_t *mp, /* mount point for filesystem */
xfs_ino_t *last, /* last inode returned */ xfs_ino_t *last, /* last inode returned */
int *count, /* size of buffer/count returned */ int *count, /* size of buffer/count returned */
xfs_caddr_t buffer);/* buffer with inode descriptions */ xfs_inogrp_t __user *buffer);/* buffer with inode descriptions */
#endif /* __XFS_ITABLE_H__ */ #endif /* __XFS_ITABLE_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment