summaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_file.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-03-14 14:07:53 +1100
committerNathan Scott <nathans@sgi.com>2006-03-14 14:07:53 +1100
commit524fbf5dd1b25acffe6f8a4ed5f3cce1023cfdb8 (patch)
tree5ab5ccf5f4c4f5b15306e8d6b1417d3ff192c700 /fs/xfs/linux-2.6/xfs_file.c
parentf30a1211119741d2c1063ad613bec8434fb9d099 (diff)
downloadop-kernel-dev-524fbf5dd1b25acffe6f8a4ed5f3cce1023cfdb8.zip
op-kernel-dev-524fbf5dd1b25acffe6f8a4ed5f3cce1023cfdb8.tar.gz
[XFS] Revert kiocb and vattr stack changes, theory is the AIO rework will
help here and vattr may be small enough. SGI-PV: 947312 SGI-Modid: xfs-linux-melb:xfs-kern:25423a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c42
1 files changed, 14 insertions, 28 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index b050e40..c271c99 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -145,22 +145,17 @@ __xfs_file_readv(
{
struct inode *inode = file->f_mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode);
- struct kiocb *kiocb;
+ struct kiocb kiocb;
ssize_t rval;
- kiocb = kmalloc(sizeof(*kiocb), GFP_KERNEL);
- if (unlikely(!kiocb))
- return -ENOMEM;
-
- init_sync_kiocb(kiocb, file);
- kiocb->ki_pos = *ppos;
+ init_sync_kiocb(&kiocb, file);
+ kiocb.ki_pos = *ppos;
if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT;
- VOP_READ(vp, kiocb, iov, nr_segs, &kiocb->ki_pos, ioflags, NULL, rval);
+ VOP_READ(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, rval);
- *ppos = kiocb->ki_pos;
- kfree(kiocb);
+ *ppos = kiocb.ki_pos;
return rval;
}
@@ -195,22 +190,17 @@ __xfs_file_writev(
{
struct inode *inode = file->f_mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode);
- struct kiocb *kiocb;
+ struct kiocb kiocb;
ssize_t rval;
- kiocb = kmalloc(sizeof(*kiocb), GFP_KERNEL);
- if (unlikely(!kiocb))
- return -ENOMEM;
-
- init_sync_kiocb(kiocb, file);
- kiocb->ki_pos = *ppos;
+ init_sync_kiocb(&kiocb, file);
+ kiocb.ki_pos = *ppos;
if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT;
- VOP_WRITE(vp, kiocb, iov, nr_segs, &kiocb->ki_pos, ioflags, NULL, rval);
+ VOP_WRITE(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, rval);
- *ppos = kiocb->ki_pos;
- kfree(kiocb);
+ *ppos = kiocb.ki_pos;
return rval;
}
@@ -420,7 +410,7 @@ xfs_file_mmap(
{
struct inode *ip = filp->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(ip);
- vattr_t *vattr;
+ vattr_t vattr;
int error;
vma->vm_ops = &xfs_file_vm_ops;
@@ -431,14 +421,10 @@ xfs_file_mmap(
}
#endif /* CONFIG_XFS_DMAPI */
- vattr = kmalloc(sizeof(*vattr), GFP_KERNEL);
- if (unlikely(!vattr))
- return -ENOMEM;
- vattr->va_mask = XFS_AT_UPDATIME;
- VOP_SETATTR(vp, vattr, XFS_AT_UPDATIME, NULL, error);
+ vattr.va_mask = XFS_AT_UPDATIME;
+ VOP_SETATTR(vp, &vattr, XFS_AT_UPDATIME, NULL, error);
if (likely(!error))
- __vn_revalidate(vp, vattr); /* update flags */
- kfree(vattr);
+ __vn_revalidate(vp, &vattr); /* update flags */
return 0;
}
OpenPOWER on IntegriCloud