summaryrefslogtreecommitdiff
path: root/fs/udf
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-01-18 16:38:35 +0300
committerJan Kara <jack@suse.cz>2023-01-26 18:46:33 +0300
commit364a6665d573128790bf52481ed2898579fbc472 (patch)
tree7a05f7d7cece850eaec2bd708168942c0ac6cbe2 /fs/udf
parent15a08f51624a252ddadf7ce95ad5256d634873fc (diff)
downloadlinux-364a6665d573128790bf52481ed2898579fbc472.tar.xz
udf: Fold udf_block_map() into udf_map_block()
udf_block_map() has now only a single caller. Fold it there. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/inode.c38
-rw-r--r--fs/udf/udfdecl.h1
2 files changed, 14 insertions, 25 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 3e0adfee29c4..08808683c7fd 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -341,9 +341,21 @@ static int udf_map_block(struct inode *inode, struct udf_map_rq *map)
map->oflags = 0;
if (!(map->iflags & UDF_MAP_CREATE)) {
- map->pblk = udf_block_map(inode, map->lblk);
- if (map->pblk != 0)
+ struct kernel_lb_addr eloc;
+ uint32_t elen;
+ sector_t offset;
+ struct extent_position epos = {};
+
+ down_read(&iinfo->i_data_sem);
+ if (inode_bmap(inode, map->lblk, &epos, &eloc, &elen, &offset)
+ == (EXT_RECORDED_ALLOCATED >> 30)) {
+ map->pblk = udf_get_lb_pblock(inode->i_sb, &eloc,
+ offset);
map->oflags |= UDF_BLK_MAPPED;
+ }
+ up_read(&iinfo->i_data_sem);
+ brelse(epos.bh);
+
return 0;
}
@@ -2291,25 +2303,3 @@ int8_t inode_bmap(struct inode *inode, sector_t block,
return etype;
}
-
-udf_pblk_t udf_block_map(struct inode *inode, sector_t block)
-{
- struct kernel_lb_addr eloc;
- uint32_t elen;
- sector_t offset;
- struct extent_position epos = {};
- udf_pblk_t ret;
-
- down_read(&UDF_I(inode)->i_data_sem);
-
- if (inode_bmap(inode, block, &epos, &eloc, &elen, &offset) ==
- (EXT_RECORDED_ALLOCATED >> 30))
- ret = udf_get_lb_pblock(inode->i_sb, &eloc, offset);
- else
- ret = 0;
-
- up_read(&UDF_I(inode)->i_data_sem);
- brelse(epos.bh);
-
- return ret;
-}
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index d791458fe52a..98b4d89b4368 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -158,7 +158,6 @@ extern struct buffer_head *udf_bread(struct inode *inode, udf_pblk_t block,
extern int udf_setsize(struct inode *, loff_t);
extern void udf_evict_inode(struct inode *);
extern int udf_write_inode(struct inode *, struct writeback_control *wbc);
-extern udf_pblk_t udf_block_map(struct inode *inode, sector_t block);
extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *,
struct kernel_lb_addr *, uint32_t *, sector_t *);
extern int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block,