GFS2: Remove unused argument from gfs2_internal_read
PATCH 1/1 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 <[email protected]>
--- fs/gfs2/aops.c | 5 ++--- fs/gfs2/inode.h | 1 - fs/gfs2/quota.c | 4 ++-- fs/gfs2/rgrp.c | 17 +++++------------ 4 files changed, 9 insertions(+), 18 deletions(-)
fs/gfs2/aops.c +2 -3
@@ -517,15 +517,14 @@ out:/** * gfs2_internal_read - read an internal file * @ip: The gfs2 inode -* @ra_state: The readahead state (or NULL for no readahead) * @buf: The buffer to fill * @pos: The file position * @size: The amount to read * */ -int gfs2_internal_read (struct gfs2_inode *ip,struct file_ra_state *ra_state, -char *buf,loff_t *pos,unsigned size) +int gfs2_internal_read (struct gfs2_inode *ip,char *buf,loff_t *pos, +unsigned size) {struct address_space *mapping = ip->i_inode.i_mapping;unsigned long index = *pos /PAGE_CACHE_SIZE ;
fs/gfs2/inode.h +0 -1
@@ -17,7 +17,6 @@extern int gfs2_releasepage (struct page *page,gfp_t gfp_mask);extern int gfs2_internal_read (struct gfs2_inode *ip, -struct file_ra_state *ra_state,char *buf,loff_t *pos,unsigned size);extern void gfs2_set_aops (struct inode *inode);
fs/gfs2/quota.c +2 -2
@@ -652,7 +652,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, }memset (&q,0 ,sizeof (struct gfs2_quota )); - err =gfs2_internal_read (ip,NULL , (char *)&q, &loc,sizeof (q)); + err =gfs2_internal_read (ip, (char *)&q, &loc,sizeof (q));if (err <0 )return err;
@@ -852,7 +852,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd)memset (&q,0 ,sizeof (struct gfs2_quota )); pos =qd2offset (qd); - error =gfs2_internal_read (ip,NULL , (char *)&q, &pos,sizeof (q)); + error =gfs2_internal_read (ip, (char *)&q, &pos,sizeof (q));if (error <0 )return error;
fs/gfs2/rgrp.c +5 -12
@@ -541,16 +541,14 @@ u64 gfs2_ri_total(struct gfs2_sbd *sdp)struct inode *inode = sdp->sd_rindex;struct gfs2_inode *ip =GFS2_I (inode);char buf[sizeof (struct gfs2_rindex )]; -struct file_ra_state ra_state;int error, rgrps; -file_ra_state_init (&ra_state, inode->i_mapping);for (rgrps =0 ;; rgrps++) {loff_t pos = rgrps *sizeof (struct gfs2_rindex );if (pos +sizeof (struct gfs2_rindex ) >i_size_read (inode))break ; - error =gfs2_internal_read (ip, &ra_state, buf, &pos, + error =gfs2_internal_read (ip, buf, &pos,sizeof (struct gfs2_rindex ));if (error !=sizeof (struct gfs2_rindex ))break ;
@@ -586,14 +584,12 @@ static int rgd_insert(struct gfs2_rgrpd *rgd)/** * read_rindex_entry - Pull in a new resource index entry from the disk -* @ip: The GFS2 inode -* @ra_state: The read-ahead state +* @ip: Pointer to the rindex inode * * Returns: 0 on success, > 0 on EOF, error code otherwise */ -static int read_rindex_entry (struct gfs2_inode *ip, -struct file_ra_state *ra_state) +static int read_rindex_entry (struct gfs2_inode *ip) {struct gfs2_sbd *sdp =GFS2_SB (&ip->i_inode);loff_t pos = sdp->sd_rgrps *sizeof (struct gfs2_rindex );
@@ -604,7 +600,7 @@ static int read_rindex_entry(struct gfs2_inode *ip,if (pos >=i_size_read (&ip->i_inode))return 1 ; - error =gfs2_internal_read (ip, ra_state, (char *)&buf, &pos, + error =gfs2_internal_read (ip, (char *)&buf, &pos,sizeof (struct gfs2_rindex ));if (error !=sizeof (struct gfs2_rindex ))
@@ -660,13 +656,10 @@ fail:static int gfs2_ri_update (struct gfs2_inode *ip) {struct gfs2_sbd *sdp =GFS2_SB (&ip->i_inode); -struct inode *inode = &ip->i_inode; -struct file_ra_state ra_state;int error; -file_ra_state_init (&ra_state, inode->i_mapping);do { - error =read_rindex_entry (ip, &ra_state); + error =read_rindex_entry (ip); }while (error ==0 );if (error <0 )
Signature · 1 line
1.7.7.6
PATCH 1/1 GFS2: Remove unused argument from gfs2_internal_read
Hi,
Now in the -nmw git tree. Thanks,
Steve.
Quoted 132 lines · Andrew Price
gfs2_internal_readaccepts an unusedra_stateargument, left over from when we did readahead on the rindex. Since there are currently no plans to add back this readahead, this patch removes thera_stateparameter and updates the functions which callgfs2_internal_readaccordingly.Signed-off-by Andrew Price <[email protected]>--- fs/gfs2/aops.c | 5 ++--- fs/gfs2/inode.h | 1 - fs/gfs2/quota.c | 4 ++-- fs/gfs2/rgrp.c | 17 +++++------------ 4 files changed, 9 insertions(+), 18 deletions(-)fs/gfs2/aops.c +2
-3@@ -517,15 +517,14 @@ out:/** * gfs2_internal_read - read an internal file * @ip: The gfs2 inode -* @ra_state: The readahead state (or NULL for no readahead) * @buf: The buffer to fill * @pos: The file position * @size: The amount to read * */ -int gfs2_internal_read (struct gfs2_inode *ip,struct file_ra_state *ra_state, -char *buf,loff_t *pos,unsigned size) +int gfs2_internal_read (struct gfs2_inode *ip,char *buf,loff_t *pos, +unsigned size) {struct address_space *mapping = ip->i_inode.i_mapping;unsigned long index = *pos /PAGE_CACHE_SIZE ;fs/gfs2/inode.h +0
-1@@ -17,7 +17,6 @@extern int gfs2_releasepage (struct page *page,gfp_t gfp_mask);extern int gfs2_internal_read (struct gfs2_inode *ip, -struct file_ra_state *ra_state,char *buf,loff_t *pos,unsigned size);extern void gfs2_set_aops (struct inode *inode);fs/gfs2/quota.c +2
-2@@ -652,7 +652,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, }memset (&q,0 ,sizeof (struct gfs2_quota )); - err =gfs2_internal_read (ip,NULL , (char *)&q, &loc,sizeof (q)); + err =gfs2_internal_read (ip, (char *)&q, &loc,sizeof (q));if (err <0 )return err;@@ -852,7 +852,7 @@ static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd)memset (&q,0 ,sizeof (struct gfs2_quota )); pos =qd2offset (qd); - error =gfs2_internal_read (ip,NULL , (char *)&q, &pos,sizeof (q)); + error =gfs2_internal_read (ip, (char *)&q, &pos,sizeof (q));if (error <0 )return error;fs/gfs2/rgrp.c +5
-12@@ -541,16 +541,14 @@ u64 gfs2_ri_total(struct gfs2_sbd *sdp)struct inode *inode = sdp->sd_rindex;struct gfs2_inode *ip =GFS2_I (inode);char buf[sizeof (struct gfs2_rindex )]; -struct file_ra_state ra_state;int error, rgrps; -file_ra_state_init (&ra_state, inode->i_mapping);for (rgrps =0 ;; rgrps++) {loff_t pos = rgrps *sizeof (struct gfs2_rindex );if (pos +sizeof (struct gfs2_rindex ) >i_size_read (inode))break ; - error =gfs2_internal_read (ip, &ra_state, buf, &pos, + error =gfs2_internal_read (ip, buf, &pos,sizeof (struct gfs2_rindex ));if (error !=sizeof (struct gfs2_rindex ))break ;@@ -586,14 +584,12 @@ static int rgd_insert(struct gfs2_rgrpd *rgd)/** * read_rindex_entry - Pull in a new resource index entry from the disk -* @ip: The GFS2 inode -* @ra_state: The read-ahead state +* @ip: Pointer to the rindex inode * * Returns: 0 on success, > 0 on EOF, error code otherwise */ -static int read_rindex_entry (struct gfs2_inode *ip, -struct file_ra_state *ra_state) +static int read_rindex_entry (struct gfs2_inode *ip) {struct gfs2_sbd *sdp =GFS2_SB (&ip->i_inode);loff_t pos = sdp->sd_rgrps *sizeof (struct gfs2_rindex );@@ -604,7 +600,7 @@ static int read_rindex_entry(struct gfs2_inode *ip,if (pos >=i_size_read (&ip->i_inode))return 1 ; - error =gfs2_internal_read (ip, ra_state, (char *)&buf, &pos, + error =gfs2_internal_read (ip, (char *)&buf, &pos,sizeof (struct gfs2_rindex ));if (error !=sizeof (struct gfs2_rindex ))@@ -660,13 +656,10 @@ fail:static int gfs2_ri_update (struct gfs2_inode *ip) {struct gfs2_sbd *sdp =GFS2_SB (&ip->i_inode); -struct inode *inode = &ip->i_inode; -struct file_ra_state ra_state;int error; -file_ra_state_init (&ra_state, inode->i_mapping);do { - error =read_rindex_entry (ip, &ra_state); + error =read_rindex_entry (ip); }while (error ==0 );if (error <0 )