Skip to content

Commit 36e7891

Browse files
Christoph HellwigLinus Torvalds
authored andcommitted
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: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7437a51 commit 36e7891

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

include/linux/fs.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,9 +1807,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
18071807
unsigned long, loff_t, loff_t *, size_t, ssize_t);
18081808
extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
18091809
extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
1810-
extern void do_generic_mapping_read(struct address_space *mapping,
1811-
struct file_ra_state *, struct file *,
1812-
loff_t *, read_descriptor_t *, read_actor_t);
18131810
extern int generic_segment_checks(const struct iovec *iov,
18141811
unsigned long *nr_segs, size_t *count, int access_flags);
18151812

@@ -1847,18 +1844,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
18471844
}
18481845
#endif
18491846

1850-
static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1851-
read_descriptor_t * desc,
1852-
read_actor_t actor)
1853-
{
1854-
do_generic_mapping_read(filp->f_mapping,
1855-
&filp->f_ra,
1856-
filp,
1857-
ppos,
1858-
desc,
1859-
actor);
1860-
}
1861-
18621847
#ifdef CONFIG_BLOCK
18631848
ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
18641849
struct block_device *bdev, const struct iovec *iov, loff_t offset,

mm/filemap.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,7 @@ static void shrink_readahead_size_eio(struct file *filp,
875875
}
876876

877877
/**
878-
* do_generic_mapping_read - generic file read routine
879-
* @mapping: address_space to be read
880-
* @ra: file's readahead state
878+
* do_generic_file_read - generic file read routine
881879
* @filp: the file to read
882880
* @ppos: current file position
883881
* @desc: read_descriptor
@@ -888,18 +886,13 @@ static void shrink_readahead_size_eio(struct file *filp,
888886
*
889887
* This is really ugly. But the goto's actually try to clarify some
890888
* of the logic when it comes to error handling etc.
891-
*
892-
* Note the struct file* is only passed for the use of readpage.
893-
* It may be NULL.
894889
*/
895-
void do_generic_mapping_read(struct address_space *mapping,
896-
struct file_ra_state *ra,
897-
struct file *filp,
898-
loff_t *ppos,
899-
read_descriptor_t *desc,
900-
read_actor_t actor)
890+
static void do_generic_file_read(struct file *filp, loff_t *ppos,
891+
read_descriptor_t *desc, read_actor_t actor)
901892
{
893+
struct address_space *mapping = filp->f_mapping;
902894
struct inode *inode = mapping->host;
895+
struct file_ra_state *ra = &filp->f_ra;
903896
pgoff_t index;
904897
pgoff_t last_index;
905898
pgoff_t prev_index;
@@ -1091,7 +1084,6 @@ void do_generic_mapping_read(struct address_space *mapping,
10911084
if (filp)
10921085
file_accessed(filp);
10931086
}
1094-
EXPORT_SYMBOL(do_generic_mapping_read);
10951087

10961088
int file_read_actor(read_descriptor_t *desc, struct page *page,
10971089
unsigned long offset, unsigned long size)

0 commit comments

Comments
 (0)