Skip to content

Commit

Permalink
direct_IO: remove rw from a_ops->direct_IO()
Browse files Browse the repository at this point in the history
Now that no one is using rw, remove it completely.

Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
osandov authored and Al Viro committed Apr 12, 2015
1 parent 6f67376 commit 22c6186
Show file tree
Hide file tree
Showing 31 changed files with 42 additions and 59 deletions.
2 changes: 1 addition & 1 deletion Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ prototypes:
void (*invalidatepage) (struct page *, unsigned int, unsigned int);
int (*releasepage) (struct page *, int);
void (*freepage)(struct page *);
int (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);
int (*direct_IO)(struct kiocb *, struct iov_iter *iter, loff_t offset);
int (*migratepage)(struct address_space *, struct page *, struct page *);
int (*launder_page)(struct page *);
int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long);
Expand Down
2 changes: 1 addition & 1 deletion Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ struct address_space_operations {
void (*invalidatepage) (struct page *, unsigned int, unsigned int);
int (*releasepage) (struct page *, int);
void (*freepage)(struct page *);
ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);
ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter, loff_t offset);
/* migrate the contents of a page to the specified target */
int (*migratepage) (struct page *, struct page *);
int (*launder_page) (struct page *);
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/llite/rw26.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ static ssize_t ll_direct_IO_26_seg(const struct lu_env *env, struct cl_io *io,
* up to 22MB for 128kB kmalloc and up to 682MB for 4MB kmalloc. */
#define MAX_DIO_SIZE ((MAX_MALLOC / sizeof(struct brw_page) * PAGE_CACHE_SIZE) & \
~(DT_MAX_BRW_SIZE - 1))
static ssize_t ll_direct_IO_26(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t file_offset)
static ssize_t ll_direct_IO_26(struct kiocb *iocb, struct iov_iter *iter,
loff_t file_offset)
{
struct lu_env *env;
struct cl_io *io;
Expand Down
3 changes: 1 addition & 2 deletions fs/9p/vfs_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ static int v9fs_launder_page(struct page *page)

/**
* v9fs_direct_IO - 9P address space operation for direct I/O
* @rw: direction (read or write)
* @iocb: target I/O control block
* @iov: array of vectors that define I/O buffer
* @pos: offset in file to begin the operation
Expand All @@ -248,7 +247,7 @@ static int v9fs_launder_page(struct page *page)
*
*/
static ssize_t
v9fs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
v9fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
{
struct file *file = iocb->ki_filp;
ssize_t n;
Expand Down
3 changes: 1 addition & 2 deletions fs/affs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ static void affs_write_failed(struct address_space *mapping, loff_t to)
}

static ssize_t
affs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
affs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
{
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
Expand Down
3 changes: 1 addition & 2 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ blkdev_get_block(struct inode *inode, sector_t iblock,
}

static ssize_t
blkdev_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -8114,8 +8114,8 @@ static ssize_t check_direct_IO(struct btrfs_root *root, struct kiocb *iocb,
return retval;
}

static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
Expand Down
3 changes: 1 addition & 2 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,8 +1198,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
* intercept O_DIRECT reads and writes early, this function should
* never get called.
*/
static ssize_t ceph_direct_io(int rw, struct kiocb *iocb,
struct iov_iter *iter,
static ssize_t ceph_direct_io(struct kiocb *iocb, struct iov_iter *iter,
loff_t pos)
{
WARN_ON(1);
Expand Down
3 changes: 1 addition & 2 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3877,8 +3877,7 @@ void cifs_oplock_break(struct work_struct *work)
* Direct IO is not yet supported in the cached mode.
*/
static ssize_t
cifs_direct_io(int rw, struct kiocb *iocb, struct iov_iter *iter,
loff_t pos)
cifs_direct_io(struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
{
/*
* FIXME
Expand Down
4 changes: 2 additions & 2 deletions fs/exofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,8 @@ static void exofs_invalidatepage(struct page *page, unsigned int offset,


/* TODO: Should be easy enough to do proprly */
static ssize_t exofs_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t exofs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
return 0;
}
Expand Down
3 changes: 1 addition & 2 deletions fs/ext2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,7 @@ static sector_t ext2_bmap(struct address_space *mapping, sector_t block)
}

static ssize_t
ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
ext2_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
{
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
Expand Down
4 changes: 2 additions & 2 deletions fs/ext3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1820,8 +1820,8 @@ static int ext3_releasepage(struct page *page, gfp_t wait)
* crashes then stale disk data _may_ be exposed inside the file. But current
* VFS code falls back into buffered path in that case so we are safe.
*/
static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t ext3_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
Expand Down
4 changes: 2 additions & 2 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3089,8 +3089,8 @@ static ssize_t ext4_ext_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
return ret;
}

static ssize_t ext4_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t ext4_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
Expand Down
4 changes: 2 additions & 2 deletions fs/f2fs/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,8 +1135,8 @@ static int check_direct_IO(struct inode *inode, struct iov_iter *iter,
return 0;
}

static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
Expand Down
3 changes: 1 addition & 2 deletions fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ static int fat_write_end(struct file *file, struct address_space *mapping,
return err;
}

static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter,
static ssize_t fat_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
Expand Down
3 changes: 1 addition & 2 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2782,8 +2782,7 @@ static inline loff_t fuse_round_up(loff_t off)
}

static ssize_t
fuse_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
{
DECLARE_COMPLETION_ONSTACK(wait);
ssize_t ret = 0;
Expand Down
4 changes: 2 additions & 2 deletions fs/gfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,8 @@ static int gfs2_ok_for_dio(struct gfs2_inode *ip, loff_t offset)



static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t gfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
Expand Down
4 changes: 2 additions & 2 deletions fs/hfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ static int hfs_releasepage(struct page *page, gfp_t mask)
return res ? try_to_free_buffers(page) : 0;
}

static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t hfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
Expand Down
4 changes: 2 additions & 2 deletions fs/hfsplus/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask)
return res ? try_to_free_buffers(page) : 0;
}

static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t hfsplus_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
Expand Down
4 changes: 2 additions & 2 deletions fs/jfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ static sector_t jfs_bmap(struct address_space *mapping, sector_t block)
return generic_block_bmap(mapping, block, jfs_get_block);
}

static ssize_t jfs_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t jfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
Expand Down
3 changes: 1 addition & 2 deletions fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ static int nfs_direct_cmp_commit_data_verf(struct nfs_direct_req *dreq,

/**
* nfs_direct_IO - NFS address space operation for direct I/O
* @rw: direction (read or write)
* @iocb: target I/O control block
* @iov: array of vectors that define I/O buffer
* @pos: offset in file to begin the operation
Expand All @@ -251,7 +250,7 @@ static int nfs_direct_cmp_commit_data_verf(struct nfs_direct_req *dreq,
* shunt off direct read and write requests before the VFS gets them,
* so this method is only ever called for swap.
*/
ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
ssize_t nfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
{
struct inode *inode = iocb->ki_filp->f_mapping->host;

Expand Down
3 changes: 1 addition & 2 deletions fs/nilfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ static int nilfs_write_end(struct file *file, struct address_space *mapping,
}

static ssize_t
nilfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
nilfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
{
struct file *file = iocb->ki_filp;
struct address_space *mapping = file->f_mapping;
Expand Down
4 changes: 1 addition & 3 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,7 @@ static ssize_t ocfs2_direct_IO_write(struct kiocb *iocb,
return ret;
}

static ssize_t ocfs2_direct_IO(int rw,
struct kiocb *iocb,
struct iov_iter *iter,
static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
Expand Down
4 changes: 2 additions & 2 deletions fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3278,8 +3278,8 @@ static int reiserfs_releasepage(struct page *page, gfp_t unused_gfp_flags)
* We thank Mingming Cao for helping us understand in great detail what
* to do in this section of the code.
*/
static ssize_t reiserfs_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
static ssize_t reiserfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
Expand Down
3 changes: 1 addition & 2 deletions fs/udf/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ static int udf_adinicb_write_begin(struct file *file,
return 0;
}

static ssize_t udf_adinicb_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter,
static ssize_t udf_adinicb_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
/* Fallback to buffered I/O. */
Expand Down
3 changes: 1 addition & 2 deletions fs/udf/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ static int udf_write_begin(struct file *file, struct address_space *mapping,
return ret;
}

static ssize_t udf_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter,
static ssize_t udf_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
loff_t offset)
{
struct file *file = iocb->ki_filp;
Expand Down
1 change: 0 additions & 1 deletion fs/xfs/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,6 @@ xfs_end_io_direct_write(

STATIC ssize_t
xfs_vm_direct_IO(
int rw,
struct kiocb *iocb,
struct iov_iter *iter,
loff_t offset)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ struct address_space_operations {
void (*invalidatepage) (struct page *, unsigned int, unsigned int);
int (*releasepage) (struct page *, gfp_t);
void (*freepage)(struct page *);
ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset);
ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *iter, loff_t offset);
/*
* migrate the contents of a page to the specified target. If
* migrate_mode is MIGRATE_ASYNC, it must not block.
Expand Down
2 changes: 1 addition & 1 deletion include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static inline struct rpc_cred *nfs_file_cred(struct file *file)
/*
* linux/fs/nfs/direct.c
*/
extern ssize_t nfs_direct_IO(int, struct kiocb *, struct iov_iter *, loff_t);
extern ssize_t nfs_direct_IO(struct kiocb *, struct iov_iter *, loff_t);
extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
struct iov_iter *iter,
loff_t pos);
Expand Down
4 changes: 2 additions & 2 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter)
pos + count - 1);
if (!retval) {
struct iov_iter data = *iter;
retval = mapping->a_ops->direct_IO(READ, iocb, &data, pos);
retval = mapping->a_ops->direct_IO(iocb, &data, pos);
}

if (retval > 0) {
Expand Down Expand Up @@ -2395,7 +2395,7 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos)
}

data = *from;
written = mapping->a_ops->direct_IO(WRITE, iocb, &data, pos);
written = mapping->a_ops->direct_IO(iocb, &data, pos);

/*
* Finally, try again to invalidate clean pages which might have been
Expand Down
4 changes: 1 addition & 3 deletions mm/page_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,

set_page_writeback(page);
unlock_page(page);
ret = mapping->a_ops->direct_IO(ITER_BVEC | WRITE,
&kiocb, &from,
kiocb.ki_pos);
ret = mapping->a_ops->direct_IO(&kiocb, &from, kiocb.ki_pos);
if (ret == PAGE_SIZE) {
count_vm_event(PSWPOUT);
ret = 0;
Expand Down

0 comments on commit 22c6186

Please sign in to comment.