Skip to content

Commit 4306629

Browse files
andypriceswhiteho
authored andcommitted
GFS2: Remove unused argument from gfs2_internal_read
gfs2_internal_read accepts an unused ra_state argument, left over from when we did readahead on the rindex. Since there are currently no plans to add back this readahead, this patch removes the ra_state parameter and updates the functions which call gfs2_internal_read accordingly. Signed-off-by: Andrew Price <anprice@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent c50b91c commit 4306629

4 files changed

Lines changed: 9 additions & 18 deletions

File tree

‎fs/gfs2/aops.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,15 +517,14 @@ static int gfs2_readpage(struct file *file, struct page *page)
517517
/**
518518
* gfs2_internal_read - read an internal file
519519
* @ip: The gfs2 inode
520-
* @ra_state: The readahead state (or NULL for no readahead)
521520
* @buf: The buffer to fill
522521
* @pos: The file position
523522
* @size: The amount to read
524523
*
525524
*/
526525

527-
int gfs2_internal_read(struct gfs2_inode *ip, struct file_ra_state *ra_state,
528-
char *buf, loff_t *pos, unsigned size)
526+
int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos,
527+
unsigned size)
529528
{
530529
struct address_space *mapping = ip->i_inode.i_mapping;
531530
unsigned long index = *pos / PAGE_CACHE_SIZE;

‎fs/gfs2/inode.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
extern int gfs2_releasepage(struct page *page, gfp_t gfp_mask);
1919
extern int gfs2_internal_read(struct gfs2_inode *ip,
20-
struct file_ra_state *ra_state,
2120
char *buf, loff_t *pos, unsigned size);
2221
extern void gfs2_set_aops(struct inode *inode);
2322

‎fs/gfs2/quota.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
652652
}
653653

654654
memset(&q, 0, sizeof(struct gfs2_quota));
655-
err = gfs2_internal_read(ip, NULL, (char *)&q, &loc, sizeof(q));
655+
err = gfs2_internal_read(ip, (char *)&q, &loc, sizeof(q));
656656
if (err < 0)
657657
return err;
658658

@@ -852,7 +852,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd)
852852

853853
memset(&q, 0, sizeof(struct gfs2_quota));
854854
pos = qd2offset(qd);
855-
error = gfs2_internal_read(ip, NULL, (char *)&q, &pos, sizeof(q));
855+
error = gfs2_internal_read(ip, (char *)&q, &pos, sizeof(q));
856856
if (error < 0)
857857
return error;
858858

‎fs/gfs2/rgrp.c‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,14 @@ u64 gfs2_ri_total(struct gfs2_sbd *sdp)
541541
struct inode *inode = sdp->sd_rindex;
542542
struct gfs2_inode *ip = GFS2_I(inode);
543543
char buf[sizeof(struct gfs2_rindex)];
544-
struct file_ra_state ra_state;
545544
int error, rgrps;
546545

547-
file_ra_state_init(&ra_state, inode->i_mapping);
548546
for (rgrps = 0;; rgrps++) {
549547
loff_t pos = rgrps * sizeof(struct gfs2_rindex);
550548

551549
if (pos + sizeof(struct gfs2_rindex) > i_size_read(inode))
552550
break;
553-
error = gfs2_internal_read(ip, &ra_state, buf, &pos,
551+
error = gfs2_internal_read(ip, buf, &pos,
554552
sizeof(struct gfs2_rindex));
555553
if (error != sizeof(struct gfs2_rindex))
556554
break;
@@ -586,14 +584,12 @@ static int rgd_insert(struct gfs2_rgrpd *rgd)
586584

587585
/**
588586
* read_rindex_entry - Pull in a new resource index entry from the disk
589-
* @ip: The GFS2 inode
590-
* @ra_state: The read-ahead state
587+
* @ip: Pointer to the rindex inode
591588
*
592589
* Returns: 0 on success, > 0 on EOF, error code otherwise
593590
*/
594591

595-
static int read_rindex_entry(struct gfs2_inode *ip,
596-
struct file_ra_state *ra_state)
592+
static int read_rindex_entry(struct gfs2_inode *ip)
597593
{
598594
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
599595
loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex);
@@ -604,7 +600,7 @@ static int read_rindex_entry(struct gfs2_inode *ip,
604600
if (pos >= i_size_read(&ip->i_inode))
605601
return 1;
606602

607-
error = gfs2_internal_read(ip, ra_state, (char *)&buf, &pos,
603+
error = gfs2_internal_read(ip, (char *)&buf, &pos,
608604
sizeof(struct gfs2_rindex));
609605

610606
if (error != sizeof(struct gfs2_rindex))
@@ -660,13 +656,10 @@ static int read_rindex_entry(struct gfs2_inode *ip,
660656
static int gfs2_ri_update(struct gfs2_inode *ip)
661657
{
662658
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
663-
struct inode *inode = &ip->i_inode;
664-
struct file_ra_state ra_state;
665659
int error;
666660

667-
file_ra_state_init(&ra_state, inode->i_mapping);
668661
do {
669-
error = read_rindex_entry(ip, &ra_state);
662+
error = read_rindex_entry(ip);
670663
} while (error == 0);
671664

672665
if (error < 0)

0 commit comments

Comments
 (0)