summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2017-01-06 15:53:56 -0500
committerJan Kara <jack@suse.cz>2017-01-10 05:54:31 -0500
commitb31c9ed99ed17f9572ee8babf2e89f1f002a7cce (patch)
treecfc2a6c298dc7b0eac7e935102df32e7175412fe
parent7ed0fbd7e3187cc24a47565afcf7fc1f46684755 (diff)
udf: remove next_epos from udf_update_extent_cache()
udf_update_extent_cache() is only called from inode_bmap() with 1 for next_epos Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/udf/inode.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 8cc5dbccebc7..b6c652d34413 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -109,7 +109,7 @@ static int udf_read_extent_cache(struct inode *inode, loff_t bcount,
109 109
110/* Add extent to extent cache */ 110/* Add extent to extent cache */
111static void udf_update_extent_cache(struct inode *inode, loff_t estart, 111static void udf_update_extent_cache(struct inode *inode, loff_t estart,
112 struct extent_position *pos, int next_epos) 112 struct extent_position *pos)
113{ 113{
114 struct udf_inode_info *iinfo = UDF_I(inode); 114 struct udf_inode_info *iinfo = UDF_I(inode);
115 115
@@ -118,19 +118,16 @@ static void udf_update_extent_cache(struct inode *inode, loff_t estart,
118 __udf_clear_extent_cache(inode); 118 __udf_clear_extent_cache(inode);
119 if (pos->bh) 119 if (pos->bh)
120 get_bh(pos->bh); 120 get_bh(pos->bh);
121 memcpy(&iinfo->cached_extent.epos, pos, 121 memcpy(&iinfo->cached_extent.epos, pos, sizeof(struct extent_position));
122 sizeof(struct extent_position));
123 iinfo->cached_extent.lstart = estart; 122 iinfo->cached_extent.lstart = estart;
124 if (next_epos) 123 switch (iinfo->i_alloc_type) {
125 switch (iinfo->i_alloc_type) { 124 case ICBTAG_FLAG_AD_SHORT:
126 case ICBTAG_FLAG_AD_SHORT: 125 iinfo->cached_extent.epos.offset -= sizeof(struct short_ad);
127 iinfo->cached_extent.epos.offset -= 126 break;
128 sizeof(struct short_ad); 127 case ICBTAG_FLAG_AD_LONG:
129 break; 128 iinfo->cached_extent.epos.offset -= sizeof(struct long_ad);
130 case ICBTAG_FLAG_AD_LONG: 129 break;
131 iinfo->cached_extent.epos.offset -= 130 }
132 sizeof(struct long_ad);
133 }
134 spin_unlock(&iinfo->i_extent_cache_lock); 131 spin_unlock(&iinfo->i_extent_cache_lock);
135} 132}
136 133
@@ -2289,7 +2286,7 @@ int8_t inode_bmap(struct inode *inode, sector_t block,
2289 lbcount += *elen; 2286 lbcount += *elen;
2290 } while (lbcount <= bcount); 2287 } while (lbcount <= bcount);
2291 /* update extent cache */ 2288 /* update extent cache */
2292 udf_update_extent_cache(inode, lbcount - *elen, pos, 1); 2289 udf_update_extent_cache(inode, lbcount - *elen, pos);
2293 *offset = (bcount + *elen - lbcount) >> blocksize_bits; 2290 *offset = (bcount + *elen - lbcount) >> blocksize_bits;
2294 2291
2295 return etype; 2292 return etype;