Skip to contentSkip to conversation

remove unused filp from ioctl functions

PATCH In review Eric Sandeen 2 participants 3 messages Nov 11, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove unused filp from ioctl functions

There's a stuct file * passed around the ioctl code that is never used... just takes up precious stack space near as I can tell :)

linux-2.4/xfs_ioctl.c |   16 +++++-----------
linux-2.6/xfs_ioctl.c |   16 +++++-----------
2 files changed, 10 insertions(+), 22 deletions(-)
linux-2.4/xfs_ioctl.c +0 -0
Index: xfs-linux-allpatches/linux-2.4/xfs_ioctl.c
===================================================================
@@ -349,7 +349,6 @@ STATIC int

xfs_readlink_by_handle(

	xfs_mount_t		*mp,
	unsigned long		arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -400,7 +399,6 @@ STATIC int
xfs_fssetdm_by_handle(
	xfs_mount_t		*mp,
	unsigned long		arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -442,7 +440,6 @@ STATIC int
xfs_attrlist_by_handle(
	xfs_mount_t		*mp,
	unsigned long		arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -563,7 +560,6 @@ STATIC int
xfs_attrmulti_by_handle(
	xfs_mount_t		*mp,
	unsigned long		arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -683,7 +679,6 @@ xfs_ioc_xattr(
STATIC int
xfs_ioc_getbmap(
	bhv_desc_t		*bdp,
-	struct file		*filp,
	int			flags,
	unsigned int		cmd,
	unsigned long		arg);

@@ -779,7 +774,7 @@ xfs_ioctl(

case XFS_IOC_GETBMAP:
case XFS_IOC_GETBMAPA:
- return xfs_ioc_getbmap(bdp, filp, ioflags, cmd, arg);
+ return xfs_ioc_getbmap(bdp, ioflags, cmd, arg);

	case XFS_IOC_GETBMAPX:
		return xfs_ioc_getbmapx(bdp, arg);
@@ -793,16 +788,16 @@ xfs_ioctl(
		return xfs_open_by_handle(mp, arg, filp, inode);

	case XFS_IOC_FSSETDM_BY_HANDLE:

- return xfs_fssetdm_by_handle(mp, arg, filp, inode);
+ return xfs_fssetdm_by_handle(mp, arg, inode);

case XFS_IOC_READLINK_BY_HANDLE:
- return xfs_readlink_by_handle(mp, arg, filp, inode);
+ return xfs_readlink_by_handle(mp, arg, inode);

case XFS_IOC_ATTRLIST_BY_HANDLE:
- return xfs_attrlist_by_handle(mp, arg, filp, inode);
+ return xfs_attrlist_by_handle(mp, arg, inode);

case XFS_IOC_ATTRMULTI_BY_HANDLE:
- return xfs_attrmulti_by_handle(mp, arg, filp, inode);
+ return xfs_attrmulti_by_handle(mp, arg, inode);

	case XFS_IOC_SWAPEXT: {
		error = xfs_swapext((struct xfs_swapext *)arg);
@@ -1258,7 +1253,6 @@ xfs_ioc_xattr(
STATIC int
xfs_ioc_getbmap(
	bhv_desc_t		*bdp,

- struct file *filp,
int ioflags,
unsigned int cmd,
unsigned long arg)

linux-2.6/xfs_ioctl.c +0 -0
Index: xfs-linux-allpatches/linux-2.6/xfs_ioctl.c
===================================================================
@@ -352,7 +352,6 @@ STATIC int

xfs_readlink_by_handle(

	xfs_mount_t		*mp,
	void			__user *arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -403,7 +402,6 @@ STATIC int
xfs_fssetdm_by_handle(
	xfs_mount_t		*mp,
	void			__user *arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -445,7 +443,6 @@ STATIC int
xfs_attrlist_by_handle(
	xfs_mount_t		*mp,
	void			__user *arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -566,7 +563,6 @@ STATIC int
xfs_attrmulti_by_handle(
	xfs_mount_t		*mp,
	void			__user *arg,
-	struct file		*parfilp,
	struct inode		*parinode)
{
	int			error;
@@ -686,7 +682,6 @@ xfs_ioc_xattr(
STATIC int
xfs_ioc_getbmap(
	bhv_desc_t		*bdp,
-	struct file		*filp,
	int			flags,
	unsigned int		cmd,
	void			__user *arg);

@@ -785,7 +780,7 @@ xfs_ioctl(

case XFS_IOC_GETBMAP:
case XFS_IOC_GETBMAPA:
- return xfs_ioc_getbmap(bdp, filp, ioflags, cmd, arg);
+ return xfs_ioc_getbmap(bdp, ioflags, cmd, arg);

	case XFS_IOC_GETBMAPX:
		return xfs_ioc_getbmapx(bdp, arg);
@@ -799,16 +794,16 @@ xfs_ioctl(
		return xfs_open_by_handle(mp, arg, filp, inode);

	case XFS_IOC_FSSETDM_BY_HANDLE:

- return xfs_fssetdm_by_handle(mp, arg, filp, inode);
+ return xfs_fssetdm_by_handle(mp, arg, inode);

case XFS_IOC_READLINK_BY_HANDLE:
- return xfs_readlink_by_handle(mp, arg, filp, inode);
+ return xfs_readlink_by_handle(mp, arg, inode);

case XFS_IOC_ATTRLIST_BY_HANDLE:
- return xfs_attrlist_by_handle(mp, arg, filp, inode);
+ return xfs_attrlist_by_handle(mp, arg, inode);

case XFS_IOC_ATTRMULTI_BY_HANDLE:
- return xfs_attrmulti_by_handle(mp, arg, filp, inode);
+ return xfs_attrmulti_by_handle(mp, arg, inode);

	case XFS_IOC_SWAPEXT: {
		error = xfs_swapext((struct xfs_swapext __user *)arg);
@@ -1278,7 +1273,6 @@ xfs_ioc_xattr(
STATIC int
xfs_ioc_getbmap(
	bhv_desc_t		*bdp,
-	struct file		*filp,
	int			ioflags,
	unsigned int		cmd,
	void			__user *arg)
#1 lore raw
Quoted 2 lines · Eric Sandeen

There's a stuct file * passed around the ioctl code that is never used... just takes up precious stack space near as I can tell :)

While you're at it kill the inode paramater anyway, it can be retrieved from the vnode by trivial address arithmetics.

#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Eric Sandeen

There's a stuct file * passed around the ioctl code that is never used... just takes up precious stack space near as I can tell :)

While you're at it kill the inode paramater anyway, it can be retrieved from the vnode by trivial address arithmetics.

Hadn't noticed, let me look into that.

-Eric