block: Remove REQ_KERNEL
authorMartin K. Petersen <martin.petersen@oracle.com>
Tue, 14 Oct 2014 15:00:44 +0000 (09:00 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 14 Oct 2014 15:00:44 +0000 (09:00 -0600)
REQ_KERNEL is no longer used. Remove it and drop the redundant uio
argument to nfs_file_direct_{read,write}.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/nfs/direct.c
fs/nfs/file.c
include/linux/blk_types.h
include/linux/fs.h
include/linux/nfs_fs.h

index 65ef6e00deee428a601e5534e2d4db6489199bf9..891f7dd8cbd6182ebf93c8fc9c4d05dd37512dd3 100644 (file)
@@ -222,11 +222,9 @@ ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter, loff_t
 #else
        VM_BUG_ON(iocb->ki_nbytes != PAGE_SIZE);
 
-       if (rw == READ || rw == KERNEL_READ)
-               return nfs_file_direct_read(iocb, iter, pos,
-                               rw == READ ? true : false);
-       return nfs_file_direct_write(iocb, iter, pos,
-                               rw == WRITE ? true : false);
+       if (rw == READ)
+               return nfs_file_direct_read(iocb, iter, pos);
+       return nfs_file_direct_write(iocb, iter, pos);
 #endif /* CONFIG_NFS_SWAP */
 }
 
@@ -512,7 +510,7 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
  * cache.
  */
 ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter,
-                               loff_t pos, bool uio)
+                               loff_t pos)
 {
        struct file *file = iocb->ki_filp;
        struct address_space *mapping = file->f_mapping;
@@ -893,7 +891,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
  * is no atomic O_APPEND write facility in the NFS protocol.
  */
 ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter,
-                               loff_t pos, bool uio)
+                               loff_t pos)
 {
        ssize_t result = -EINVAL;
        struct file *file = iocb->ki_filp;
index 524dd80d189862db5a76a7bb9e8a263ce857ffeb..3b42cb86218e4c2caeb60d19d87c75000e71fd0a 100644 (file)
@@ -171,7 +171,7 @@ nfs_file_read(struct kiocb *iocb, struct iov_iter *to)
        ssize_t result;
 
        if (iocb->ki_filp->f_flags & O_DIRECT)
-               return nfs_file_direct_read(iocb, to, iocb->ki_pos, true);
+               return nfs_file_direct_read(iocb, to, iocb->ki_pos);
 
        dprintk("NFS: read(%pD2, %zu@%lu)\n",
                iocb->ki_filp,
@@ -648,7 +648,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
                return result;
 
        if (file->f_flags & O_DIRECT)
-               return nfs_file_direct_write(iocb, from, pos, true);
+               return nfs_file_direct_write(iocb, from, pos);
 
        dprintk("NFS: write(%pD2, %zu@%Ld)\n",
                file, count, (long long) pos);
index 38bc008e450323da7b72b363bb28ff3bfff9df6b..445d59231bc4cc242e2aa0e1ca073e3c320af56c 100644 (file)
@@ -187,7 +187,6 @@ enum rq_flag_bits {
        __REQ_FLUSH_SEQ,        /* request for flush sequence */
        __REQ_IO_STAT,          /* account I/O stat */
        __REQ_MIXED_MERGE,      /* merge of different types, fail separately */
-       __REQ_KERNEL,           /* direct IO to kernel pages */
        __REQ_PM,               /* runtime pm request */
        __REQ_HASHED,           /* on IO scheduler merge hash */
        __REQ_MQ_INFLIGHT,      /* track inflight for MQ */
@@ -241,7 +240,6 @@ enum rq_flag_bits {
 #define REQ_IO_STAT            (1ULL << __REQ_IO_STAT)
 #define REQ_MIXED_MERGE                (1ULL << __REQ_MIXED_MERGE)
 #define REQ_SECURE             (1ULL << __REQ_SECURE)
-#define REQ_KERNEL             (1ULL << __REQ_KERNEL)
 #define REQ_PM                 (1ULL << __REQ_PM)
 #define REQ_HASHED             (1ULL << __REQ_HASHED)
 #define REQ_MQ_INFLIGHT                (1ULL << __REQ_MQ_INFLIGHT)
index 94187721ad412c6c8da4b44e946d24ecd240beb0..9b5bc1cacb8e09340dcc6f63c526bba0b5ccd1f5 100644 (file)
@@ -192,8 +192,6 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
 #define READ                   0
 #define WRITE                  RW_MASK
 #define READA                  RWA_MASK
-#define KERNEL_READ            (READ|REQ_KERNEL)
-#define KERNEL_WRITE           (WRITE|REQ_KERNEL)
 
 #define READ_SYNC              (READ | REQ_SYNC)
 #define WRITE_SYNC             (WRITE | REQ_SYNC | REQ_NOIDLE)
index 5180a7ededecf2797b4cb4a23c1a223f48bbe3cf..e6e1c4e0d7f3a6f4f17f815c5efd7f1443106a7d 100644 (file)
@@ -464,10 +464,10 @@ extern int nfs3_removexattr (struct dentry *, const char *name);
 extern ssize_t nfs_direct_IO(int, struct kiocb *, struct iov_iter *, loff_t);
 extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
                        struct iov_iter *iter,
-                       loff_t pos, bool uio);
+                       loff_t pos);
 extern ssize_t nfs_file_direct_write(struct kiocb *iocb,
                        struct iov_iter *iter,
-                       loff_t pos, bool uio);
+                       loff_t pos);
 
 /*
  * linux/fs/nfs/dir.c