Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2601
b: refs/heads/master
c: 6fac0cb
h: refs/heads/master
i:
  2599: 90f0f3e
v: v3
  • Loading branch information
Dean Roehrich authored and Nathan Scott committed Jun 21, 2005
1 parent efb62a8 commit 5bdb046
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b74e2159c9849fb97659c6dc47ad706f702b22b9
refs/heads/master: 6fac0cb46bc4c50d6cbc5998ad206435f39fb00f
27 changes: 24 additions & 3 deletions trunk/fs/xfs/linux-2.6/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
#include <linux/smp_lock.h>

static struct vm_operations_struct linvfs_file_vm_ops;

#ifdef CONFIG_XFS_DMAPI
static struct vm_operations_struct linvfs_dmapi_file_vm_ops;
#endif

STATIC inline ssize_t
__linvfs_read(
Expand Down Expand Up @@ -388,6 +390,14 @@ linvfs_readdir(
return -error;
}

#ifdef CONFIG_XFS_DMAPI
STATIC void
linvfs_mmap_close(
struct vm_area_struct *vma)
{
xfs_dm_mm_put(vma);
}
#endif /* CONFIG_XFS_DMAPI */

STATIC int
linvfs_file_mmap(
Expand All @@ -399,16 +409,19 @@ linvfs_file_mmap(
vattr_t va = { .va_mask = XFS_AT_UPDATIME };
int error;

vma->vm_ops = &linvfs_file_vm_ops;

if (vp->v_vfsp->vfs_flag & VFS_DMI) {
xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);

error = -XFS_SEND_MMAP(mp, vma, 0);
if (error)
return error;
#ifdef CONFIG_XFS_DMAPI
vma->vm_ops = &linvfs_dmapi_file_vm_ops;
#endif
}

vma->vm_ops = &linvfs_file_vm_ops;

VOP_SETATTR(vp, &va, XFS_AT_UPDATIME, NULL, error);
if (!error)
vn_revalidate(vp); /* update Linux inode flags */
Expand Down Expand Up @@ -609,7 +622,15 @@ struct file_operations linvfs_dir_operations = {
static struct vm_operations_struct linvfs_file_vm_ops = {
.nopage = filemap_nopage,
.populate = filemap_populate,
};

#ifdef CONFIG_XFS_DMAPI
static struct vm_operations_struct linvfs_dmapi_file_vm_ops = {
.close = linvfs_mmap_close,
.nopage = filemap_nopage,
.populate = filemap_populate,
#ifdef HAVE_VMOP_MPROTECT
.mprotect = linvfs_mprotect,
#endif
};
#endif /* CONFIG_XFS_DMAPI */
4 changes: 4 additions & 0 deletions trunk/fs/xfs/xfs_dmapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,8 @@ void xfs_dm_exit(struct file_system_type *);
#define XFS_DM_EXIT(fstype)
#endif

#define HAVE_XFS_DM_MM
int xfs_dm_mm_get(struct vm_area_struct *vma);
void xfs_dm_mm_put(struct vm_area_struct *vma);

#endif /* __XFS_DMAPI_H__ */

0 comments on commit 5bdb046

Please sign in to comment.