diff options
author | Andrew Price <anprice@redhat.com> | 2012-04-16 11:40:55 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-04-24 11:44:37 -0400 |
commit | 4306629e1c0fd098d52f499e5a60aaa03e30df0d (patch) | |
tree | 82e2f8768dd0d273d31bb83eb8e10c1501eceece /fs/gfs2 | |
parent | c50b91c4bd511dfe844e2aa7be429b6b88406353 (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')
-rw-r--r-- | fs/gfs2/aops.c | 5 | ||||
-rw-r--r-- | fs/gfs2/inode.h | 1 | ||||
-rw-r--r-- | fs/gfs2/quota.c | 4 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 17 |
4 files changed, 9 insertions, 18 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index a627b3ee5c9f..695bbe16d1f0 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c | |||
@@ -517,15 +517,14 @@ out: | |||
517 | /** | 517 | /** |
518 | * gfs2_internal_read - read an internal file | 518 | * gfs2_internal_read - read an internal file |
519 | * @ip: The gfs2 inode | 519 | * @ip: The gfs2 inode |
520 | * @ra_state: The readahead state (or NULL for no readahead) | ||
521 | * @buf: The buffer to fill | 520 | * @buf: The buffer to fill |
522 | * @pos: The file position | 521 | * @pos: The file position |
523 | * @size: The amount to read | 522 | * @size: The amount to read |
524 | * | 523 | * |
525 | */ | 524 | */ |
526 | 525 | ||
527 | int gfs2_internal_read(struct gfs2_inode *ip, struct file_ra_state *ra_state, | 526 | int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, |
528 | char *buf, loff_t *pos, unsigned size) | 527 | unsigned size) |
529 | { | 528 | { |
530 | struct address_space *mapping = ip->i_inode.i_mapping; | 529 | struct address_space *mapping = ip->i_inode.i_mapping; |
531 | unsigned long index = *pos / PAGE_CACHE_SIZE; | 530 | unsigned long index = *pos / PAGE_CACHE_SIZE; |
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 5d345b402773..c53c7477f6da 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | extern int gfs2_releasepage(struct page *page, gfp_t gfp_mask); | 18 | extern int gfs2_releasepage(struct page *page, gfp_t gfp_mask); |
19 | extern int gfs2_internal_read(struct gfs2_inode *ip, | 19 | extern int gfs2_internal_read(struct gfs2_inode *ip, |
20 | struct file_ra_state *ra_state, | ||
21 | char *buf, loff_t *pos, unsigned size); | 20 | char *buf, loff_t *pos, unsigned size); |
22 | extern void gfs2_set_aops(struct inode *inode); | 21 | extern void gfs2_set_aops(struct inode *inode); |
23 | 22 | ||
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 6019da3dcaed..45d9171e078b 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -652,7 +652,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, | |||
652 | } | 652 | } |
653 | 653 | ||
654 | memset(&q, 0, sizeof(struct gfs2_quota)); | 654 | 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)); |
656 | if (err < 0) | 656 | if (err < 0) |
657 | return err; | 657 | return err; |
658 | 658 | ||
@@ -852,7 +852,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd) | |||
852 | 852 | ||
853 | memset(&q, 0, sizeof(struct gfs2_quota)); | 853 | memset(&q, 0, sizeof(struct gfs2_quota)); |
854 | pos = qd2offset(qd); | 854 | 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)); |
856 | if (error < 0) | 856 | if (error < 0) |
857 | return error; | 857 | return error; |
858 | 858 | ||
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 | ||
595 | static int read_rindex_entry(struct gfs2_inode *ip, | 592 | static 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: | |||
660 | static int gfs2_ri_update(struct gfs2_inode *ip) | 656 | static 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) |