ocfs2: Make ocfs2_get_quota_block() consistent with ocfs2_read_quota_block()

Make function return error status and not buffer pointer so that it's
consistent with ocfs2_read_quota_block().

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
This commit is contained in:
Jan Kara 2008-11-25 15:31:29 +01:00 committed by Mark Fasheh
parent af09e51b68
commit 53a3604610
1 changed files with 13 additions and 14 deletions

View File

@ -104,26 +104,25 @@ int ocfs2_read_quota_block(struct inode *inode, u64 v_block,
return rc; return rc;
} }
static struct buffer_head *ocfs2_get_quota_block(struct inode *inode, static int ocfs2_get_quota_block(struct inode *inode, int block,
int block, int *err) struct buffer_head **bh)
{ {
u64 pblock, pcount; u64 pblock, pcount;
struct buffer_head *bh; int err;
down_read(&OCFS2_I(inode)->ip_alloc_sem); down_read(&OCFS2_I(inode)->ip_alloc_sem);
*err = ocfs2_extent_map_get_blocks(inode, block, &pblock, &pcount, err = ocfs2_extent_map_get_blocks(inode, block, &pblock, &pcount, NULL);
NULL);
up_read(&OCFS2_I(inode)->ip_alloc_sem); up_read(&OCFS2_I(inode)->ip_alloc_sem);
if (*err) { if (err) {
mlog_errno(*err); mlog_errno(err);
return NULL; return err;
} }
bh = sb_getblk(inode->i_sb, pblock); *bh = sb_getblk(inode->i_sb, pblock);
if (!bh) { if (!*bh) {
*err = -EIO; err = -EIO;
mlog_errno(*err); mlog_errno(err);
} }
return bh; return err;;
} }
/* Read data from global quotafile - avoid pagecache and such because we cannot /* Read data from global quotafile - avoid pagecache and such because we cannot
@ -209,7 +208,7 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type,
err = ocfs2_read_quota_block(gqinode, blk, &bh); err = ocfs2_read_quota_block(gqinode, blk, &bh);
ja_type = OCFS2_JOURNAL_ACCESS_WRITE; ja_type = OCFS2_JOURNAL_ACCESS_WRITE;
} else { } else {
bh = ocfs2_get_quota_block(gqinode, blk, &err); err = ocfs2_get_quota_block(gqinode, blk, &bh);
ja_type = OCFS2_JOURNAL_ACCESS_CREATE; ja_type = OCFS2_JOURNAL_ACCESS_CREATE;
} }
if (err) { if (err) {