Commit 75de706c authored by Nathan Scott's avatar Nathan Scott Committed by Nathan Scott

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

SGI Modid: xfs-linux:xfs-kern:174339a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 5b4f64d9
...@@ -104,12 +104,12 @@ linvfs_read_invis( ...@@ -104,12 +104,12 @@ linvfs_read_invis(
STATIC inline ssize_t STATIC inline ssize_t
__linvfs_write( __linvfs_write(
struct kiocb *iocb, struct kiocb *iocb,
const char *buf, const char __user *buf,
int ioflags, int ioflags,
size_t count, size_t count,
loff_t pos) loff_t pos)
{ {
struct iovec iov = {(void *)buf, count}; struct iovec iov = { (void __user *)buf, count};
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = LINVFS_GET_VP(inode);
...@@ -259,7 +259,7 @@ linvfs_sendfile( ...@@ -259,7 +259,7 @@ linvfs_sendfile(
loff_t *ppos, loff_t *ppos,
size_t count, size_t count,
read_actor_t actor, read_actor_t actor,
void *target) void __user *target)
{ {
vnode_t *vp = LINVFS_GET_VP(filp->f_dentry->d_inode); vnode_t *vp = LINVFS_GET_VP(filp->f_dentry->d_inode);
ssize_t rval; ssize_t rval;
...@@ -442,7 +442,7 @@ linvfs_ioctl( ...@@ -442,7 +442,7 @@ linvfs_ioctl(
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = LINVFS_GET_VP(inode);
unlock_kernel(); unlock_kernel();
VOP_IOCTL(vp, inode, filp, 0, cmd, arg, error); VOP_IOCTL(vp, inode, filp, 0, cmd, (void __user *)arg, error);
VMODIFY(vp); VMODIFY(vp);
lock_kernel(); lock_kernel();
...@@ -467,7 +467,7 @@ linvfs_ioctl_invis( ...@@ -467,7 +467,7 @@ linvfs_ioctl_invis(
unlock_kernel(); unlock_kernel();
ASSERT(vp); ASSERT(vp);
VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, arg, error); VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, (void __user *)arg, error);
VMODIFY(vp); VMODIFY(vp);
lock_kernel(); lock_kernel();
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
STATIC int STATIC int
xfs_find_handle( xfs_find_handle(
unsigned int cmd, unsigned int cmd,
unsigned long arg) void __user *arg)
{ {
int hsize; int hsize;
xfs_handle_t handle; xfs_handle_t handle;
...@@ -113,7 +113,7 @@ xfs_find_handle( ...@@ -113,7 +113,7 @@ xfs_find_handle(
struct nameidata nd; struct nameidata nd;
int error; int error;
error = user_path_walk_link(hreq.path, &nd); error = user_path_walk_link((const char __user *)hreq.path, &nd);
if (error) if (error)
return error; return error;
...@@ -211,14 +211,14 @@ xfs_vget_fsop_handlereq( ...@@ -211,14 +211,14 @@ xfs_vget_fsop_handlereq(
xfs_mount_t *mp, xfs_mount_t *mp,
struct inode *parinode, /* parent inode pointer */ struct inode *parinode, /* parent inode pointer */
int cap, /* capability level for op */ int cap, /* capability level for op */
unsigned long arg, /* userspace data pointer */ void __user *arg, /* userspace data pointer */
unsigned long size, /* size of expected struct */ unsigned long size, /* size of expected struct */
/* output arguments */ /* output arguments */
xfs_fsop_handlereq_t *hreq, xfs_fsop_handlereq_t *hreq,
vnode_t **vp, vnode_t **vp,
struct inode **inode) struct inode **inode)
{ {
void *hanp; void __user *hanp;
size_t hlen; size_t hlen;
xfs_fid_t *xfid; xfs_fid_t *xfid;
xfs_handle_t *handlep; xfs_handle_t *handlep;
...@@ -300,7 +300,7 @@ xfs_vget_fsop_handlereq( ...@@ -300,7 +300,7 @@ xfs_vget_fsop_handlereq(
STATIC int STATIC int
xfs_open_by_handle( xfs_open_by_handle(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg, void __user *arg,
struct file *parfilp, struct file *parfilp,
struct inode *parinode) struct inode *parinode)
{ {
...@@ -383,7 +383,7 @@ xfs_open_by_handle( ...@@ -383,7 +383,7 @@ xfs_open_by_handle(
STATIC int STATIC int
xfs_readlink_by_handle( xfs_readlink_by_handle(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg, void __user *arg,
struct file *parfilp, struct file *parfilp,
struct inode *parinode) struct inode *parinode)
{ {
...@@ -429,7 +429,7 @@ xfs_readlink_by_handle( ...@@ -429,7 +429,7 @@ xfs_readlink_by_handle(
STATIC int STATIC int
xfs_fssetdm_by_handle( xfs_fssetdm_by_handle(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg, void __user *arg,
struct file *parfilp, struct file *parfilp,
struct inode *parinode) struct inode *parinode)
{ {
...@@ -469,7 +469,7 @@ xfs_fssetdm_by_handle( ...@@ -469,7 +469,7 @@ xfs_fssetdm_by_handle(
STATIC int STATIC int
xfs_attrlist_by_handle( xfs_attrlist_by_handle(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg, void __user *arg,
struct file *parfilp, struct file *parfilp,
struct inode *parinode) struct inode *parinode)
{ {
...@@ -498,7 +498,7 @@ xfs_attrlist_by_handle( ...@@ -498,7 +498,7 @@ xfs_attrlist_by_handle(
STATIC int STATIC int
xfs_attrmulti_by_handle( xfs_attrmulti_by_handle(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg, void __user *arg,
struct file *parfilp, struct file *parfilp,
struct inode *parinode) struct inode *parinode)
{ {
...@@ -577,23 +577,23 @@ xfs_ioc_space( ...@@ -577,23 +577,23 @@ xfs_ioc_space(
struct file *filp, struct file *filp,
int flags, int flags,
unsigned int cmd, unsigned int cmd,
unsigned long arg); void __user *arg);
STATIC int STATIC int
xfs_ioc_bulkstat( xfs_ioc_bulkstat(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned int cmd, unsigned int cmd,
unsigned long arg); void __user *arg);
STATIC int STATIC int
xfs_ioc_fsgeometry_v1( xfs_ioc_fsgeometry_v1(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg); void __user *arg);
STATIC int STATIC int
xfs_ioc_fsgeometry( xfs_ioc_fsgeometry(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg); void __user *arg);
STATIC int STATIC int
xfs_ioc_xattr( xfs_ioc_xattr(
...@@ -601,7 +601,7 @@ xfs_ioc_xattr( ...@@ -601,7 +601,7 @@ xfs_ioc_xattr(
xfs_inode_t *ip, xfs_inode_t *ip,
struct file *filp, struct file *filp,
unsigned int cmd, unsigned int cmd,
unsigned long arg); void __user *arg);
STATIC int STATIC int
xfs_ioc_getbmap( xfs_ioc_getbmap(
...@@ -609,12 +609,12 @@ xfs_ioc_getbmap( ...@@ -609,12 +609,12 @@ xfs_ioc_getbmap(
struct file *filp, struct file *filp,
int flags, int flags,
unsigned int cmd, unsigned int cmd,
unsigned long arg); void __user *arg);
STATIC int STATIC int
xfs_ioc_getbmapx( xfs_ioc_getbmapx(
bhv_desc_t *bdp, bhv_desc_t *bdp,
unsigned long arg); void __user *arg);
int int
xfs_ioctl( xfs_ioctl(
...@@ -623,7 +623,7 @@ xfs_ioctl( ...@@ -623,7 +623,7 @@ xfs_ioctl(
struct file *filp, struct file *filp,
int ioflags, int ioflags,
unsigned int cmd, unsigned int cmd,
unsigned long arg) void __user *arg)
{ {
int error; int error;
vnode_t *vp; vnode_t *vp;
...@@ -730,7 +730,7 @@ xfs_ioctl( ...@@ -730,7 +730,7 @@ xfs_ioctl(
return xfs_attrmulti_by_handle(mp, arg, filp, inode); return xfs_attrmulti_by_handle(mp, arg, filp, inode);
case XFS_IOC_SWAPEXT: { case XFS_IOC_SWAPEXT: {
error = xfs_swapext((struct xfs_swapext *)arg); error = xfs_swapext((struct xfs_swapext __user *)arg);
return -error; return -error;
} }
...@@ -880,7 +880,7 @@ xfs_ioc_space( ...@@ -880,7 +880,7 @@ xfs_ioc_space(
struct file *filp, struct file *filp,
int ioflags, int ioflags,
unsigned int cmd, unsigned int cmd,
unsigned long arg) void __user *arg)
{ {
xfs_flock64_t bf; xfs_flock64_t bf;
int attr_flags = 0; int attr_flags = 0;
...@@ -912,7 +912,7 @@ STATIC int ...@@ -912,7 +912,7 @@ STATIC int
xfs_ioc_bulkstat( xfs_ioc_bulkstat(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned int cmd, unsigned int cmd,
unsigned long arg) void __user *arg)
{ {
xfs_fsop_bulkreq_t bulkreq; xfs_fsop_bulkreq_t bulkreq;
int count; /* # of records returned */ int count; /* # of records returned */
...@@ -975,7 +975,7 @@ xfs_ioc_bulkstat( ...@@ -975,7 +975,7 @@ xfs_ioc_bulkstat(
STATIC int STATIC int
xfs_ioc_fsgeometry_v1( xfs_ioc_fsgeometry_v1(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg) void __user *arg)
{ {
xfs_fsop_geom_v1_t fsgeo; xfs_fsop_geom_v1_t fsgeo;
int error; int error;
...@@ -992,7 +992,7 @@ xfs_ioc_fsgeometry_v1( ...@@ -992,7 +992,7 @@ xfs_ioc_fsgeometry_v1(
STATIC int STATIC int
xfs_ioc_fsgeometry( xfs_ioc_fsgeometry(
xfs_mount_t *mp, xfs_mount_t *mp,
unsigned long arg) void __user *arg)
{ {
xfs_fsop_geom_t fsgeo; xfs_fsop_geom_t fsgeo;
int error; int error;
...@@ -1071,7 +1071,7 @@ xfs_ioc_xattr( ...@@ -1071,7 +1071,7 @@ xfs_ioc_xattr(
xfs_inode_t *ip, xfs_inode_t *ip,
struct file *filp, struct file *filp,
unsigned int cmd, unsigned int cmd,
unsigned long arg) void __user *arg)
{ {
struct fsxattr fa; struct fsxattr fa;
vattr_t va; vattr_t va;
...@@ -1176,7 +1176,7 @@ xfs_ioc_getbmap( ...@@ -1176,7 +1176,7 @@ xfs_ioc_getbmap(
struct file *filp, struct file *filp,
int ioflags, int ioflags,
unsigned int cmd, unsigned int cmd,
unsigned long arg) void __user *arg)
{ {
struct getbmap bm; struct getbmap bm;
int iflags; int iflags;
...@@ -1192,7 +1192,7 @@ xfs_ioc_getbmap( ...@@ -1192,7 +1192,7 @@ xfs_ioc_getbmap(
if (ioflags & IO_INVIS) if (ioflags & IO_INVIS)
iflags |= BMV_IF_NO_DMAPI_READ; iflags |= BMV_IF_NO_DMAPI_READ;
error = xfs_getbmap(bdp, &bm, (struct getbmap *)arg+1, iflags); error = xfs_getbmap(bdp, &bm, (struct getbmap __user *)arg+1, iflags);
if (error) if (error)
return -error; return -error;
...@@ -1204,7 +1204,7 @@ xfs_ioc_getbmap( ...@@ -1204,7 +1204,7 @@ xfs_ioc_getbmap(
STATIC int STATIC int
xfs_ioc_getbmapx( xfs_ioc_getbmapx(
bhv_desc_t *bdp, bhv_desc_t *bdp,
unsigned long arg) void __user *arg)
{ {
struct getbmapx bmx; struct getbmapx bmx;
struct getbmap bm; struct getbmap bm;
...@@ -1230,7 +1230,7 @@ xfs_ioc_getbmapx( ...@@ -1230,7 +1230,7 @@ xfs_ioc_getbmapx(
iflags |= BMV_IF_EXTENDED; iflags |= BMV_IF_EXTENDED;
error = xfs_getbmap(bdp, &bm, (struct getbmapx *)arg+1, iflags); error = xfs_getbmap(bdp, &bm, (struct getbmapx __user *)arg+1, iflags);
if (error) if (error)
return -error; return -error;
......
...@@ -376,7 +376,7 @@ linvfs_rename( ...@@ -376,7 +376,7 @@ linvfs_rename(
STATIC int STATIC int
linvfs_readlink( linvfs_readlink(
struct dentry *dentry, struct dentry *dentry,
char *buf, char __user *buf,
int size) int size)
{ {
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); vnode_t *vp = LINVFS_GET_VP(dentry->d_inode);
......
...@@ -46,6 +46,6 @@ extern int linvfs_get_block(struct inode *, sector_t, struct buffer_head *, int) ...@@ -46,6 +46,6 @@ extern int linvfs_get_block(struct inode *, sector_t, struct buffer_head *, int)
extern void linvfs_unwritten_done(struct buffer_head *, int); extern void linvfs_unwritten_done(struct buffer_head *, int);
extern int xfs_ioctl(struct bhv_desc *, struct inode *, struct file *, extern int xfs_ioctl(struct bhv_desc *, struct inode *, struct file *,
int, unsigned int, unsigned long); int, unsigned int, void __user *);
#endif /* __XFS_IOPS_H__ */ #endif /* __XFS_IOPS_H__ */
...@@ -366,7 +366,7 @@ xfs_sendfile( ...@@ -366,7 +366,7 @@ xfs_sendfile(
int ioflags, int ioflags,
size_t count, size_t count,
read_actor_t actor, read_actor_t actor,
void *target, void __user *target,
cred_t *credp) cred_t *credp)
{ {
ssize_t ret; ssize_t ret;
......
...@@ -104,7 +104,7 @@ extern ssize_t xfs_write(struct bhv_desc *, struct kiocb *, ...@@ -104,7 +104,7 @@ extern ssize_t xfs_write(struct bhv_desc *, struct kiocb *,
loff_t *, int, struct cred *); loff_t *, int, struct cred *);
extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *, extern ssize_t xfs_sendfile(struct bhv_desc *, struct file *,
loff_t *, int, size_t, read_actor_t, loff_t *, int, size_t, read_actor_t,
void *, struct cred *); void __user *, struct cred *);
extern int xfs_dev_is_read_only(struct xfs_mount *, char *); extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
......
...@@ -45,7 +45,7 @@ xfs_stats_clear_proc_handler( ...@@ -45,7 +45,7 @@ xfs_stats_clear_proc_handler(
ctl_table *ctl, ctl_table *ctl,
int write, int write,
struct file *filp, struct file *filp,
void *buffer, void __user *buffer,
size_t *lenp, size_t *lenp,
loff_t *ppos) loff_t *ppos)
{ {
......
...@@ -192,9 +192,9 @@ typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct kiocb *, ...@@ -192,9 +192,9 @@ typedef ssize_t (*vop_write_t)(bhv_desc_t *, struct kiocb *,
loff_t *, int, struct cred *); loff_t *, int, struct cred *);
typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *, typedef ssize_t (*vop_sendfile_t)(bhv_desc_t *, struct file *,
loff_t *, int, size_t, read_actor_t, loff_t *, int, size_t, read_actor_t,
void *, struct cred *); void __user *, struct cred *);
typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *, typedef int (*vop_ioctl_t)(bhv_desc_t *, struct inode *, struct file *,
int, unsigned int, unsigned long); int, unsigned int, void __user *);
typedef int (*vop_getattr_t)(bhv_desc_t *, struct vattr *, int, typedef int (*vop_getattr_t)(bhv_desc_t *, struct vattr *, int,
struct cred *); struct cred *);
typedef int (*vop_setattr_t)(bhv_desc_t *, struct vattr *, int, typedef int (*vop_setattr_t)(bhv_desc_t *, struct vattr *, int,
......
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