Commit 36e78914 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

kill do_generic_mapping_read

do_generic_mapping_read was used by gfs2 for internals reads, but this use
of the interface was rather suboptimal (as was the whole interface) and has
been replaced by an internal helper now.  This patch kills
do_generic_mapping_read and surrounding damage in preparation of additional
cleanups for the buffered read path.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7437a51b
...@@ -1807,9 +1807,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, ...@@ -1807,9 +1807,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
unsigned long, loff_t, loff_t *, size_t, ssize_t); unsigned long, loff_t, loff_t *, size_t, ssize_t);
extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
extern void do_generic_mapping_read(struct address_space *mapping,
struct file_ra_state *, struct file *,
loff_t *, read_descriptor_t *, read_actor_t);
extern int generic_segment_checks(const struct iovec *iov, extern int generic_segment_checks(const struct iovec *iov,
unsigned long *nr_segs, size_t *count, int access_flags); unsigned long *nr_segs, size_t *count, int access_flags);
...@@ -1847,18 +1844,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from) ...@@ -1847,18 +1844,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
} }
#endif #endif
static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
read_descriptor_t * desc,
read_actor_t actor)
{
do_generic_mapping_read(filp->f_mapping,
&filp->f_ra,
filp,
ppos,
desc,
actor);
}
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
struct block_device *bdev, const struct iovec *iov, loff_t offset, struct block_device *bdev, const struct iovec *iov, loff_t offset,
......
...@@ -875,9 +875,7 @@ static void shrink_readahead_size_eio(struct file *filp, ...@@ -875,9 +875,7 @@ static void shrink_readahead_size_eio(struct file *filp,
} }
/** /**
* do_generic_mapping_read - generic file read routine * do_generic_file_read - generic file read routine
* @mapping: address_space to be read
* @ra: file's readahead state
* @filp: the file to read * @filp: the file to read
* @ppos: current file position * @ppos: current file position
* @desc: read_descriptor * @desc: read_descriptor
...@@ -888,18 +886,13 @@ static void shrink_readahead_size_eio(struct file *filp, ...@@ -888,18 +886,13 @@ static void shrink_readahead_size_eio(struct file *filp,
* *
* This is really ugly. But the goto's actually try to clarify some * This is really ugly. But the goto's actually try to clarify some
* of the logic when it comes to error handling etc. * of the logic when it comes to error handling etc.
*
* Note the struct file* is only passed for the use of readpage.
* It may be NULL.
*/ */
void do_generic_mapping_read(struct address_space *mapping, static void do_generic_file_read(struct file *filp, loff_t *ppos,
struct file_ra_state *ra, read_descriptor_t *desc, read_actor_t actor)
struct file *filp,
loff_t *ppos,
read_descriptor_t *desc,
read_actor_t actor)
{ {
struct address_space *mapping = filp->f_mapping;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
struct file_ra_state *ra = &filp->f_ra;
pgoff_t index; pgoff_t index;
pgoff_t last_index; pgoff_t last_index;
pgoff_t prev_index; pgoff_t prev_index;
...@@ -1091,7 +1084,6 @@ void do_generic_mapping_read(struct address_space *mapping, ...@@ -1091,7 +1084,6 @@ void do_generic_mapping_read(struct address_space *mapping,
if (filp) if (filp)
file_accessed(filp); file_accessed(filp);
} }
EXPORT_SYMBOL(do_generic_mapping_read);
int file_read_actor(read_descriptor_t *desc, struct page *page, int file_read_actor(read_descriptor_t *desc, struct page *page,
unsigned long offset, unsigned long size) unsigned long offset, unsigned long size)
......
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