mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
udf: Use udf_map_block() in udf_getblk()
Use the new function udf_map_block() in udf_getblk(). Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
@@ -405,14 +405,15 @@ static struct buffer_head *udf_getblk(struct inode *inode, udf_pblk_t block,
|
|||||||
int create, int *err)
|
int create, int *err)
|
||||||
{
|
{
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
struct buffer_head dummy;
|
struct udf_map_rq map = {
|
||||||
|
.lblk = block,
|
||||||
|
.iflags = UDF_MAP_NOPREALLOC | (create ? UDF_MAP_CREATE : 0),
|
||||||
|
};
|
||||||
|
|
||||||
dummy.b_state = 0;
|
*err = udf_map_block(inode, &map);
|
||||||
dummy.b_blocknr = -1000;
|
if (!*err && map.oflags & UDF_BLK_MAPPED) {
|
||||||
*err = udf_get_block(inode, block, &dummy, create);
|
bh = sb_getblk(inode->i_sb, map.pblk);
|
||||||
if (!*err && buffer_mapped(&dummy)) {
|
if (map.oflags & UDF_BLK_NEW) {
|
||||||
bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
|
|
||||||
if (buffer_new(&dummy)) {
|
|
||||||
lock_buffer(bh);
|
lock_buffer(bh);
|
||||||
memset(bh->b_data, 0x00, inode->i_sb->s_blocksize);
|
memset(bh->b_data, 0x00, inode->i_sb->s_blocksize);
|
||||||
set_buffer_uptodate(bh);
|
set_buffer_uptodate(bh);
|
||||||
|
|||||||
Reference in New Issue
Block a user