aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/rgrp.c
diff options
context:
space:
mode:
authorAndrew Price <anprice@redhat.com>2012-04-16 11:40:55 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-04-24 11:44:37 -0400
commit4306629e1c0fd098d52f499e5a60aaa03e30df0d (patch)
tree82e2f8768dd0d273d31bb83eb8e10c1501eceece /fs/gfs2/rgrp.c
parentc50b91c4bd511dfe844e2aa7be429b6b88406353 (diff)
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>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r--fs/gfs2/rgrp.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 7a1cf67d7db2..b550e5c1e797 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -541,16 +541,14 @@ u64 gfs2_ri_total(struct gfs2_sbd *sdp)
541 struct inode *inode = sdp->sd_rindex; 541 struct inode *inode = sdp->sd_rindex;
542 struct gfs2_inode *ip = GFS2_I(inode); 542 struct gfs2_inode *ip = GFS2_I(inode);
543 char buf[sizeof(struct gfs2_rindex)]; 543 char buf[sizeof(struct gfs2_rindex)];
544 struct file_ra_state ra_state;
545 int error, rgrps; 544 int error, rgrps;
546 545
547 file_ra_state_init(&ra_state, inode->i_mapping);
548 for (rgrps = 0;; rgrps++) { 546 for (rgrps = 0;; rgrps++) {
549 loff_t pos = rgrps * sizeof(struct gfs2_rindex); 547 loff_t pos = rgrps * sizeof(struct gfs2_rindex);
550 548
551 if (pos + sizeof(struct gfs2_rindex) > i_size_read(inode)) 549 if (pos + sizeof(struct gfs2_rindex) > i_size_read(inode))
552 break; 550 break;
553 error = gfs2_internal_read(ip, &ra_state, buf, &pos, 551 error = gfs2_internal_read(ip, buf, &pos,
554 sizeof(struct gfs2_rindex)); 552 sizeof(struct gfs2_rindex));
555 if (error != sizeof(struct gfs2_rindex)) 553 if (error != sizeof(struct gfs2_rindex))
556 break; 554 break;
@@ -586,14 +584,12 @@ static int rgd_insert(struct gfs2_rgrpd *rgd)
586 584
587/** 585/**
588 * read_rindex_entry - Pull in a new resource index entry from the disk 586 * read_rindex_entry - Pull in a new resource index entry from the disk
589 * @ip: The GFS2 inode 587 * @ip: Pointer to the rindex inode
590 * @ra_state: The read-ahead state
591 * 588 *
592 * Returns: 0 on success, > 0 on EOF, error code otherwise 589 * Returns: 0 on success, > 0 on EOF, error code otherwise
593 */ 590 */
594 591
595static int read_rindex_entry(struct gfs2_inode *ip, 592static int read_rindex_entry(struct gfs2_inode *ip)
596 struct file_ra_state *ra_state)
597{ 593{
598 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 594 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
599 loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex); 595 loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex);
@@ -604,7 +600,7 @@ static int read_rindex_entry(struct gfs2_inode *ip,
604 if (pos >= i_size_read(&ip->i_inode)) 600 if (pos >= i_size_read(&ip->i_inode))
605 return 1; 601 return 1;
606 602
607 error = gfs2_internal_read(ip, ra_state, (char *)&buf, &pos, 603 error = gfs2_internal_read(ip, (char *)&buf, &pos,
608 sizeof(struct gfs2_rindex)); 604 sizeof(struct gfs2_rindex));
609 605
610 if (error != sizeof(struct gfs2_rindex)) 606 if (error != sizeof(struct gfs2_rindex))
@@ -660,13 +656,10 @@ fail:
660static int gfs2_ri_update(struct gfs2_inode *ip) 656static int gfs2_ri_update(struct gfs2_inode *ip)
661{ 657{
662 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 658 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
663 struct inode *inode = &ip->i_inode;
664 struct file_ra_state ra_state;
665 int error; 659 int error;
666 660
667 file_ra_state_init(&ra_state, inode->i_mapping);
668 do { 661 do {
669 error = read_rindex_entry(ip, &ra_state); 662 error = read_rindex_entry(ip);
670 } while (error == 0); 663 } while (error == 0);
671 664
672 if (error < 0) 665 if (error < 0)