Commit db055715 authored by Christoph Hellwig's avatar Christoph Hellwig

[XFS] fix direct I/O size calculation

parent e602b8f6
......@@ -34,8 +34,9 @@
#include <xfs_fsops.h>
#include <xfs_dfrag.h>
#include <linux/dcache.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/pagemap.h>
extern int xfs_change_file_space(bhv_desc_t *, int,
......@@ -591,17 +592,16 @@ xfs_ioctl(
case XFS_IOC_DIOINFO: {
struct dioattr da;
da.d_miniosz = mp->m_sb.sb_blocksize;
da.d_mem = mp->m_sb.sb_blocksize;
/*
* this only really needs to be BBSIZE.
* it is set to the file system block size to
* avoid having to do block zeroing on short writes.
*/
#define KIO_MAX_ATOMIC_IO 512 /* FIXME: what do we really want here? */
da.d_maxiosz = XFS_FSB_TO_B(mp,
XFS_B_TO_FSBT(mp, KIO_MAX_ATOMIC_IO << 10));
da.d_miniosz = mp->m_sb.sb_blocksize;
da.d_mem = mp->m_sb.sb_blocksize;
/* The size dio will do in one go */
da.d_maxiosz = 64 * PAGE_CACHE_SIZE;
if (copy_to_user((struct dioattr *)arg, &da, sizeof(da)))
return -XFS_ERROR(EFAULT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment