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