udf: use extent cache when moving to last extent
PATCH 6/6 udf: use extent cache when moving to last extent
From: Namjae Jeon <[email protected]>
Use extent cache when moving to last extent.
Signed-off-by Namjae Jeon <[email protected]>
Signed-off-by Ashish Sangwan <[email protected]>
--- fs/udf/truncate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/udf/truncate.c +4 -2
@@ -88,6 +88,8 @@ void udf_truncate_tail_extent(struct inode *inode) adsize =sizeof (struct long_ad ); elseBUG (); +if (!udf_read_extent_cache (inode, inode->i_size, &lbcount, &epos)) + epos.block = iinfo->i_location;/* Find the last extent in the file */ while ((netype =udf_next_aext (inode, &epos, &eloc, &elen,1 )) !=-1 ) {
@@ -139,8 +141,8 @@ void udf_discard_prealloc(struct inode *inode) adsize =sizeof (struct long_ad ); else adsize =0 ; - - epos.block = iinfo->i_location; +if (!udf_read_extent_cache (inode, inode->i_size, &lbcount, &epos)) + epos.block = iinfo->i_location;/* Find the last extent in the file */ while ((netype =udf_next_aext (inode, &epos, &eloc, &elen,1 )) !=-1 ) {
Signature · 1 line
1.7.9.5