linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: move XFS_IOC_GETVERSION to main multiplexer
@ 2006-07-08 18:12 Alexey Dobriyan
  2006-07-09  0:50 ` Nathan Scott
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2006-07-08 18:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: xfs, linux-fsdevel

* Don't do inode => vnode => inode conversion, use passed inode directly
* Don't allocate and free memory on each call
* As a consequence, don't have a chance to return ENOMEM, which would be
  truly bizarre error code for this ioctl.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/xfs/linux-2.6/xfs_ioctl.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -763,6 +763,8 @@ xfs_ioctl(
 		return xfs_ioc_fsgeometry(mp, arg);
 
 	case XFS_IOC_GETVERSION:
+		return put_user(inode->i_generation, (int __user *)arg);
+
 	case XFS_IOC_GETXFLAGS:
 	case XFS_IOC_SETXFLAGS:
 	case XFS_IOC_FSGETXATTR:
@@ -1264,13 +1266,6 @@ xfs_ioc_xattr(
 		break;
 	}
 
-	case XFS_IOC_GETVERSION: {
-		flags = vn_to_inode(vp)->i_generation;
-		if (copy_to_user(arg, &flags, sizeof(flags)))
-			error = -EFAULT;
-		break;
-	}
-
 	default:
 		error = -ENOTTY;
 		break;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: move XFS_IOC_GETVERSION to main multiplexer
  2006-07-08 18:12 [PATCH] xfs: move XFS_IOC_GETVERSION to main multiplexer Alexey Dobriyan
@ 2006-07-09  0:50 ` Nathan Scott
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Scott @ 2006-07-09  0:50 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Andrew Morton, xfs, linux-fsdevel

On Sat, Jul 08, 2006 at 10:12:52PM +0400, Alexey Dobriyan wrote:
> * Don't do inode => vnode => inode conversion, use passed inode directly
> * Don't allocate and free memory on each call
> * As a consequence, don't have a chance to return ENOMEM, which would be
>   truly bizarre error code for this ioctl.

Yoohoo, I'm over here... send XFS patches to me please.  Thats the
second time I've asked you that... is there a problem there?

> +		return put_user(inode->i_generation, (int __user *)arg);
> +

Looks fine, I'll merge it when I'm in the office tomorrow.  You've
tested this change, right?

cheers.

-- 
Nathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-09  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-08 18:12 [PATCH] xfs: move XFS_IOC_GETVERSION to main multiplexer Alexey Dobriyan
2006-07-09  0:50 ` Nathan Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).