Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7587
b: refs/heads/master
c: bb3f724
h: refs/heads/master
i:
  7585: 228a853
  7583: 84c99a6
v: v3
  • Loading branch information
Dean Roehrich authored and Nathan Scott committed Sep 2, 2005
1 parent 8a1f40b commit e0015a2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 59 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: 536388be42c938fb6d0eece681526ce13bb50aab
refs/heads/master: bb3f724e12eb9c62c92ff6f14a856bc58ba35f5e
90 changes: 32 additions & 58 deletions trunk/fs/xfs/linux-2.6/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,31 @@ linvfs_fsync(

#define nextdp(dp) ((struct xfs_dirent *)((char *)(dp) + (dp)->d_reclen))

#ifdef CONFIG_XFS_DMAPI

STATIC struct page *
linvfs_filemap_nopage(
struct vm_area_struct *area,
unsigned long address,
int *type)
{
struct inode *inode = area->vm_file->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(inode);
xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
int error;

ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI);

error = XFS_SEND_MMAP(mp, area, 0);
if (error)
return NULL;

return filemap_nopage(area, address, type);
}

#endif /* CONFIG_XFS_DMAPI */


STATIC int
linvfs_readdir(
struct file *filp,
Expand Down Expand Up @@ -390,14 +415,6 @@ 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 @@ -411,16 +428,11 @@ linvfs_file_mmap(

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
if (vp->v_vfsp->vfs_flag & VFS_DMI) {
vma->vm_ops = &linvfs_dmapi_file_vm_ops;
#endif
}
#endif /* CONFIG_XFS_DMAPI */

VOP_SETATTR(vp, &va, XFS_AT_UPDATIME, NULL, error);
if (!error)
Expand Down Expand Up @@ -474,6 +486,7 @@ linvfs_ioctl_invis(
return error;
}

#ifdef CONFIG_XFS_DMAPI
#ifdef HAVE_VMOP_MPROTECT
STATIC int
linvfs_mprotect(
Expand All @@ -494,6 +507,7 @@ linvfs_mprotect(
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
Expand Down Expand Up @@ -528,49 +542,10 @@ linvfs_open_exec(
}
#endif /* HAVE_FOP_OPEN_EXEC */

/*
* Temporary workaround to the AIO direct IO write problem.
* This code can go and we can revert to do_sync_write once
* the writepage(s) rework is merged.
*/
STATIC ssize_t
linvfs_write(
struct file *filp,
const char __user *buf,
size_t len,
loff_t *ppos)
{
struct kiocb kiocb;
ssize_t ret;

init_sync_kiocb(&kiocb, filp);
kiocb.ki_pos = *ppos;
ret = __linvfs_write(&kiocb, buf, 0, len, kiocb.ki_pos);
*ppos = kiocb.ki_pos;
return ret;
}
STATIC ssize_t
linvfs_write_invis(
struct file *filp,
const char __user *buf,
size_t len,
loff_t *ppos)
{
struct kiocb kiocb;
ssize_t ret;

init_sync_kiocb(&kiocb, filp);
kiocb.ki_pos = *ppos;
ret = __linvfs_write(&kiocb, buf, IO_INVIS, len, kiocb.ki_pos);
*ppos = kiocb.ki_pos;
return ret;
}


struct file_operations linvfs_file_operations = {
.llseek = generic_file_llseek,
.read = do_sync_read,
.write = linvfs_write,
.write = do_sync_write,
.readv = linvfs_readv,
.writev = linvfs_writev,
.aio_read = linvfs_aio_read,
Expand All @@ -592,7 +567,7 @@ struct file_operations linvfs_file_operations = {
struct file_operations linvfs_invis_file_operations = {
.llseek = generic_file_llseek,
.read = do_sync_read,
.write = linvfs_write_invis,
.write = do_sync_write,
.readv = linvfs_readv_invis,
.writev = linvfs_writev_invis,
.aio_read = linvfs_aio_read_invis,
Expand Down Expand Up @@ -626,8 +601,7 @@ static struct vm_operations_struct linvfs_file_vm_ops = {

#ifdef CONFIG_XFS_DMAPI
static struct vm_operations_struct linvfs_dmapi_file_vm_ops = {
.close = linvfs_mmap_close,
.nopage = filemap_nopage,
.nopage = linvfs_filemap_nopage,
.populate = filemap_populate,
#ifdef HAVE_VMOP_MPROTECT
.mprotect = linvfs_mprotect,
Expand Down

0 comments on commit e0015a2

Please sign in to comment.