public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH, mainline-only] remove dmapi cruft in xfs_file.c
@ 2008-02-08  4:44 Christoph Hellwig
  2008-02-20  3:59 ` Niv Sardi
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Christoph Hellwig @ 2008-02-08  4:44 UTC (permalink / raw)
  To: xfs

The dmapi cruft in xfs_file.c is totally out of date in mainline vs
CVS, and at this point just removing this code which can't be used on
mainline at all seems to be the best option to keep it maintainable.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/xfs/linux-2.6/xfs_file.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_file.c	2008-02-08 05:30:57.000000000 +0100
+++ linux-2.6/fs/xfs/linux-2.6/xfs_file.c	2008-02-08 05:31:26.000000000 +0100
@@ -43,9 +43,6 @@
 #include <linux/smp_lock.h>
 
 static struct vm_operations_struct xfs_file_vm_ops;
-#ifdef CONFIG_XFS_DMAPI
-static struct vm_operations_struct xfs_dmapi_file_vm_ops;
-#endif
 
 STATIC_INLINE ssize_t
 __xfs_file_read(
@@ -202,22 +199,6 @@ xfs_file_fsync(
 			(xfs_off_t)0, (xfs_off_t)-1);
 }
 
-#ifdef CONFIG_XFS_DMAPI
-STATIC int
-xfs_vm_fault(
-	struct vm_area_struct	*vma,
-	struct vm_fault	*vmf)
-{
-	struct inode	*inode = vma->vm_file->f_path.dentry->d_inode;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
-
-	ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI);
-	if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), vma, 0))
-		return VM_FAULT_SIGBUS;
-	return filemap_fault(vma, vmf);
-}
-#endif /* CONFIG_XFS_DMAPI */
-
 /*
  * Unfortunately we can't just use the clean and simple readdir implementation
  * below, because nfs might call back into ->lookup from the filldir callback
@@ -386,11 +367,6 @@ xfs_file_mmap(
 	vma->vm_ops = &xfs_file_vm_ops;
 	vma->vm_flags |= VM_CAN_NONLINEAR;
 
-#ifdef CONFIG_XFS_DMAPI
-	if (XFS_M(filp->f_path.dentry->d_inode->i_sb)->m_flags & XFS_MOUNT_DMAPI)
-		vma->vm_ops = &xfs_dmapi_file_vm_ops;
-#endif /* CONFIG_XFS_DMAPI */
-
 	file_accessed(filp);
 	return 0;
 }
@@ -437,52 +413,6 @@ xfs_file_ioctl_invis(
 	return error;
 }
 
-#ifdef CONFIG_XFS_DMAPI
-#ifdef HAVE_VMOP_MPROTECT
-STATIC int
-xfs_vm_mprotect(
-	struct vm_area_struct *vma,
-	unsigned int	newflags)
-{
-	struct inode	*inode = vma->vm_file->f_path.dentry->d_inode;
-	struct xfs_mount *mp = XFS_M(inode->i_sb);
-	int		error = 0;
-
-	if (mp->m_flags & XFS_MOUNT_DMAPI) {
-		if ((vma->vm_flags & VM_MAYSHARE) &&
-		    (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE))
-			error = XFS_SEND_MMAP(mp, vma, VM_WRITE);
-	}
-	return error;
-}
-#endif /* HAVE_VMOP_MPROTECT */
-#endif /* CONFIG_XFS_DMAPI */
-
-#ifdef HAVE_FOP_OPEN_EXEC
-/* If the user is attempting to execute a file that is offline then
- * we have to trigger a DMAPI READ event before the file is marked as busy
- * otherwise the invisible I/O will not be able to write to the file to bring
- * it back online.
- */
-STATIC int
-xfs_file_open_exec(
-	struct inode	*inode)
-{
-	struct xfs_mount *mp = XFS_M(inode->i_sb);
-
-	if (unlikely(mp->m_flags & XFS_MOUNT_DMAPI)) {
-		if (DM_EVENT_ENABLED(XFS_I(inode), DM_EVENT_READ)) {
-			bhv_vnode_t *vp = vn_from_inode(inode);
-
-			return -XFS_SEND_DATA(mp, DM_EVENT_READ,
-						vp, 0, 0, 0, NULL);
-		}
-	}
-
-	return 0;
-}
-#endif /* HAVE_FOP_OPEN_EXEC */
-
 /*
  * mmap()d file has taken write protection fault and is being made
  * writable. We can set the page state up correctly for a writable
@@ -551,13 +481,3 @@ static struct vm_operations_struct xfs_f
 	.fault		= filemap_fault,
 	.page_mkwrite	= xfs_vm_page_mkwrite,
 };
-
-#ifdef CONFIG_XFS_DMAPI
-static struct vm_operations_struct xfs_dmapi_file_vm_ops = {
-	.fault		= xfs_vm_fault,
-	.page_mkwrite	= xfs_vm_page_mkwrite,
-#ifdef HAVE_VMOP_MPROTECT
-	.mprotect	= xfs_vm_mprotect,
-#endif
-};
-#endif /* CONFIG_XFS_DMAPI */

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

* Re: [PATCH, mainline-only] remove dmapi cruft in xfs_file.c
  2008-02-08  4:44 [PATCH, mainline-only] remove dmapi cruft in xfs_file.c Christoph Hellwig
@ 2008-02-20  3:59 ` Niv Sardi
  2008-02-22  3:26 ` Niv Sardi
  2008-02-28 22:40 ` Eric Sandeen
  2 siblings, 0 replies; 5+ messages in thread
From: Niv Sardi @ 2008-02-20  3:59 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

* Christoph Hellwig <hch@lst.de> [2008-02-08 05:44:06 +0100]:

> The dmapi cruft in xfs_file.c is totally out of date in mainline vs
> CVS, and at this point just removing this code which can't be used on
> mainline at all seems to be the best option to keep it maintainable.

looks reasonable, I'll make sure it gets pushed to oss->mainline.
-- 
Niv

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

* Re: [PATCH, mainline-only] remove dmapi cruft in xfs_file.c
  2008-02-08  4:44 [PATCH, mainline-only] remove dmapi cruft in xfs_file.c Christoph Hellwig
  2008-02-20  3:59 ` Niv Sardi
@ 2008-02-22  3:26 ` Niv Sardi
  2008-02-28 22:40 ` Eric Sandeen
  2 siblings, 0 replies; 5+ messages in thread
From: Niv Sardi @ 2008-02-22  3:26 UTC (permalink / raw)
  To: Lachlan McIlroy; +Cc: xfs


Hey Lachy, can you push that to git@oss (it makes no sense in dev) ?

Thanks.

Christoph Hellwig <hch@lst.de> writes:

> The dmapi cruft in xfs_file.c is totally out of date in mainline vs
> CVS, and at this point just removing this code which can't be used on
> mainline at all seems to be the best option to keep it maintainable.
>
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Niv Sardi <xaiki@sgi.com>
>
> Index: linux-2.6/fs/xfs/linux-2.6/xfs_file.c
> ===================================================================
> --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_file.c	2008-02-08 05:30:57.000000000 +0100
> +++ linux-2.6/fs/xfs/linux-2.6/xfs_file.c	2008-02-08 05:31:26.000000000 +0100
> @@ -43,9 +43,6 @@
>  #include <linux/smp_lock.h>
>  
>  static struct vm_operations_struct xfs_file_vm_ops;
> -#ifdef CONFIG_XFS_DMAPI
> -static struct vm_operations_struct xfs_dmapi_file_vm_ops;
> -#endif
>  
>  STATIC_INLINE ssize_t
>  __xfs_file_read(
> @@ -202,22 +199,6 @@ xfs_file_fsync(
>  			(xfs_off_t)0, (xfs_off_t)-1);
>  }
>  
> -#ifdef CONFIG_XFS_DMAPI
> -STATIC int
> -xfs_vm_fault(
> -	struct vm_area_struct	*vma,
> -	struct vm_fault	*vmf)
> -{
> -	struct inode	*inode = vma->vm_file->f_path.dentry->d_inode;
> -	bhv_vnode_t	*vp = vn_from_inode(inode);
> -
> -	ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI);
> -	if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), vma, 0))
> -		return VM_FAULT_SIGBUS;
> -	return filemap_fault(vma, vmf);
> -}
> -#endif /* CONFIG_XFS_DMAPI */
> -
>  /*
>   * Unfortunately we can't just use the clean and simple readdir implementation
>   * below, because nfs might call back into ->lookup from the filldir callback
> @@ -386,11 +367,6 @@ xfs_file_mmap(
>  	vma->vm_ops = &xfs_file_vm_ops;
>  	vma->vm_flags |= VM_CAN_NONLINEAR;
>  
> -#ifdef CONFIG_XFS_DMAPI
> -	if (XFS_M(filp->f_path.dentry->d_inode->i_sb)->m_flags & XFS_MOUNT_DMAPI)
> -		vma->vm_ops = &xfs_dmapi_file_vm_ops;
> -#endif /* CONFIG_XFS_DMAPI */
> -
>  	file_accessed(filp);
>  	return 0;
>  }
> @@ -437,52 +413,6 @@ xfs_file_ioctl_invis(
>  	return error;
>  }
>  
> -#ifdef CONFIG_XFS_DMAPI
> -#ifdef HAVE_VMOP_MPROTECT
> -STATIC int
> -xfs_vm_mprotect(
> -	struct vm_area_struct *vma,
> -	unsigned int	newflags)
> -{
> -	struct inode	*inode = vma->vm_file->f_path.dentry->d_inode;
> -	struct xfs_mount *mp = XFS_M(inode->i_sb);
> -	int		error = 0;
> -
> -	if (mp->m_flags & XFS_MOUNT_DMAPI) {
> -		if ((vma->vm_flags & VM_MAYSHARE) &&
> -		    (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE))
> -			error = XFS_SEND_MMAP(mp, vma, VM_WRITE);
> -	}
> -	return error;
> -}
> -#endif /* HAVE_VMOP_MPROTECT */
> -#endif /* CONFIG_XFS_DMAPI */
> -
> -#ifdef HAVE_FOP_OPEN_EXEC
> -/* If the user is attempting to execute a file that is offline then
> - * we have to trigger a DMAPI READ event before the file is marked as busy
> - * otherwise the invisible I/O will not be able to write to the file to bring
> - * it back online.
> - */
> -STATIC int
> -xfs_file_open_exec(
> -	struct inode	*inode)
> -{
> -	struct xfs_mount *mp = XFS_M(inode->i_sb);
> -
> -	if (unlikely(mp->m_flags & XFS_MOUNT_DMAPI)) {
> -		if (DM_EVENT_ENABLED(XFS_I(inode), DM_EVENT_READ)) {
> -			bhv_vnode_t *vp = vn_from_inode(inode);
> -
> -			return -XFS_SEND_DATA(mp, DM_EVENT_READ,
> -						vp, 0, 0, 0, NULL);
> -		}
> -	}
> -
> -	return 0;
> -}
> -#endif /* HAVE_FOP_OPEN_EXEC */
> -
>  /*
>   * mmap()d file has taken write protection fault and is being made
>   * writable. We can set the page state up correctly for a writable
> @@ -551,13 +481,3 @@ static struct vm_operations_struct xfs_f
>  	.fault		= filemap_fault,
>  	.page_mkwrite	= xfs_vm_page_mkwrite,
>  };
> -
> -#ifdef CONFIG_XFS_DMAPI
> -static struct vm_operations_struct xfs_dmapi_file_vm_ops = {
> -	.fault		= xfs_vm_fault,
> -	.page_mkwrite	= xfs_vm_page_mkwrite,
> -#ifdef HAVE_VMOP_MPROTECT
> -	.mprotect	= xfs_vm_mprotect,
> -#endif
> -};
> -#endif /* CONFIG_XFS_DMAPI */
>

-- 
Niv Sardi

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

* Re: [PATCH, mainline-only] remove dmapi cruft in xfs_file.c
  2008-02-08  4:44 [PATCH, mainline-only] remove dmapi cruft in xfs_file.c Christoph Hellwig
  2008-02-20  3:59 ` Niv Sardi
  2008-02-22  3:26 ` Niv Sardi
@ 2008-02-28 22:40 ` Eric Sandeen
  2008-02-28 23:30   ` Christoph Hellwig
  2 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2008-02-28 22:40 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

Christoph Hellwig wrote:
> The dmapi cruft in xfs_file.c is totally out of date in mainline vs
> CVS, and at this point just removing this code which can't be used on
> mainline at all seems to be the best option to keep it maintainable.

When doing this should probably whack the:

#ifdef HAVE_FOP_OPEN_EXEC
        .open_exec      = xfs_file_open_exec,
#endif

from xfs_file_operations, too?

-Eric

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

* Re: [PATCH, mainline-only] remove dmapi cruft in xfs_file.c
  2008-02-28 22:40 ` Eric Sandeen
@ 2008-02-28 23:30   ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2008-02-28 23:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, xfs

On Thu, Feb 28, 2008 at 04:40:09PM -0600, Eric Sandeen wrote:
> Christoph Hellwig wrote:
> > The dmapi cruft in xfs_file.c is totally out of date in mainline vs
> > CVS, and at this point just removing this code which can't be used on
> > mainline at all seems to be the best option to keep it maintainable.
> 
> When doing this should probably whack the:
> 
> #ifdef HAVE_FOP_OPEN_EXEC
>         .open_exec      = xfs_file_open_exec,
> #endif
> 
> from xfs_file_operations, too?

Yes,  but no urgeny for now as we've missed the .25 window anyway.

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

end of thread, other threads:[~2008-02-28 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08  4:44 [PATCH, mainline-only] remove dmapi cruft in xfs_file.c Christoph Hellwig
2008-02-20  3:59 ` Niv Sardi
2008-02-22  3:26 ` Niv Sardi
2008-02-28 22:40 ` Eric Sandeen
2008-02-28 23:30   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox