aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_ioctl32.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-12-09 04:47:33 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-12-10 21:14:41 -0500
commit4d4be482a4d78ca906f45e99fd9fdb91e907f5ad (patch)
tree52974b28fecd3c11fc0596504270ffee976f1b1a /fs/xfs/linux-2.6/xfs_ioctl32.c
parent6d73cf133c5477f7038577bfeda603ce9946f8cb (diff)
[XFS] add a FMODE flag to make XFS invisible I/O less hacky
XFS has a mode called invisble I/O that doesn't update any of the timestamps. It's used for HSM-style applications and exposed through the nasty open by handle ioctl. Instead of doing directly assignment of file operations that set an internal flag for it add a new FMODE_NOCMTIME flag that we can check in the normal file operations. (addition of the generic VFS flag has been ACKed by Al as an interims solution) Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl32.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl32.c56
1 files changed, 19 insertions, 37 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
index b34b3d8892a..0504cece9f6 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl32.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
@@ -599,19 +599,24 @@ out:
599 return error; 599 return error;
600} 600}
601 601
602STATIC long 602long
603xfs_compat_ioctl( 603xfs_file_compat_ioctl(
604 xfs_inode_t *ip, 604 struct file *filp,
605 struct file *filp, 605 unsigned cmd,
606 int ioflags, 606 unsigned long p)
607 unsigned cmd,
608 void __user *arg)
609{ 607{
610 struct inode *inode = filp->f_path.dentry->d_inode; 608 struct inode *inode = filp->f_path.dentry->d_inode;
611 xfs_mount_t *mp = ip->i_mount; 609 struct xfs_inode *ip = XFS_I(inode);
612 int error; 610 struct xfs_mount *mp = ip->i_mount;
611 void __user *arg = (void __user *)p;
612 int ioflags = 0;
613 int error;
614
615 if (filp->f_mode & FMODE_NOCMTIME)
616 ioflags |= IO_INVIS;
617
618 xfs_itrace_entry(ip);
613 619
614 xfs_itrace_entry(XFS_I(inode));
615 switch (cmd) { 620 switch (cmd) {
616 /* No size or alignment issues on any arch */ 621 /* No size or alignment issues on any arch */
617 case XFS_IOC_DIOINFO: 622 case XFS_IOC_DIOINFO:
@@ -632,7 +637,7 @@ xfs_compat_ioctl(
632 case XFS_IOC_GOINGDOWN: 637 case XFS_IOC_GOINGDOWN:
633 case XFS_IOC_ERROR_INJECTION: 638 case XFS_IOC_ERROR_INJECTION:
634 case XFS_IOC_ERROR_CLEARALL: 639 case XFS_IOC_ERROR_CLEARALL:
635 return xfs_ioctl(ip, filp, ioflags, cmd, arg); 640 return xfs_file_ioctl(filp, cmd, p);
636#ifndef BROKEN_X86_ALIGNMENT 641#ifndef BROKEN_X86_ALIGNMENT
637 /* These are handled fine if no alignment issues */ 642 /* These are handled fine if no alignment issues */
638 case XFS_IOC_ALLOCSP: 643 case XFS_IOC_ALLOCSP:
@@ -646,7 +651,7 @@ xfs_compat_ioctl(
646 case XFS_IOC_FSGEOMETRY_V1: 651 case XFS_IOC_FSGEOMETRY_V1:
647 case XFS_IOC_FSGROWFSDATA: 652 case XFS_IOC_FSGROWFSDATA:
648 case XFS_IOC_FSGROWFSRT: 653 case XFS_IOC_FSGROWFSRT:
649 return xfs_ioctl(ip, filp, ioflags, cmd, arg); 654 return xfs_file_ioctl(filp, cmd, p);
650#else 655#else
651 case XFS_IOC_ALLOCSP_32: 656 case XFS_IOC_ALLOCSP_32:
652 case XFS_IOC_FREESP_32: 657 case XFS_IOC_FREESP_32:
@@ -687,7 +692,7 @@ xfs_compat_ioctl(
687 case XFS_IOC_SETXFLAGS_32: 692 case XFS_IOC_SETXFLAGS_32:
688 case XFS_IOC_GETVERSION_32: 693 case XFS_IOC_GETVERSION_32:
689 cmd = _NATIVE_IOC(cmd, long); 694 cmd = _NATIVE_IOC(cmd, long);
690 return xfs_ioctl(ip, filp, ioflags, cmd, arg); 695 return xfs_file_ioctl(filp, cmd, p);
691 case XFS_IOC_SWAPEXT: { 696 case XFS_IOC_SWAPEXT: {
692 struct xfs_swapext sxp; 697 struct xfs_swapext sxp;
693 struct compat_xfs_swapext __user *sxu = arg; 698 struct compat_xfs_swapext __user *sxu = arg;
@@ -738,26 +743,3 @@ xfs_compat_ioctl(
738 return -XFS_ERROR(ENOIOCTLCMD); 743 return -XFS_ERROR(ENOIOCTLCMD);
739 } 744 }
740} 745}
741
742long
743xfs_file_compat_ioctl(
744 struct file *filp,
745 unsigned int cmd,
746 unsigned long p)
747{
748 struct inode *inode = filp->f_path.dentry->d_inode;
749
750 return xfs_compat_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p);
751}
752
753long
754xfs_file_compat_invis_ioctl(
755 struct file *filp,
756 unsigned int cmd,
757 unsigned long p)
758{
759 struct inode *inode = filp->f_path.dentry->d_inode;
760
761 return xfs_compat_ioctl(XFS_I(inode), filp, IO_INVIS, cmd,
762 (void __user *)p);
763}