aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-11-25 09:31:29 -0500
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:25 -0500
commit53a3604610e92a5344cf8003c19975583e71a598 (patch)
treec0b0caef727d1ead4132a4c52fa34af1dbf46acd
parentaf09e51b6810d3408db1c0e956b3b0687b0e3723 (diff)
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>
-rw-r--r--fs/ocfs2/quota_global.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index 8fceb0c49b3e..e527ec6e0133 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -104,26 +104,25 @@ int ocfs2_read_quota_block(struct inode *inode, u64 v_block,
104 return rc; 104 return rc;
105} 105}
106 106
107static struct buffer_head *ocfs2_get_quota_block(struct inode *inode, 107static int ocfs2_get_quota_block(struct inode *inode, int block,
108 int block, int *err) 108 struct buffer_head **bh)
109{ 109{
110 u64 pblock, pcount; 110 u64 pblock, pcount;
111 struct buffer_head *bh; 111 int err;
112 112
113 down_read(&OCFS2_I(inode)->ip_alloc_sem); 113 down_read(&OCFS2_I(inode)->ip_alloc_sem);
114 *err = ocfs2_extent_map_get_blocks(inode, block, &pblock, &pcount, 114 err = ocfs2_extent_map_get_blocks(inode, block, &pblock, &pcount, NULL);
115 NULL);
116 up_read(&OCFS2_I(inode)->ip_alloc_sem); 115 up_read(&OCFS2_I(inode)->ip_alloc_sem);
117 if (*err) { 116 if (err) {
118 mlog_errno(*err); 117 mlog_errno(err);
119 return NULL; 118 return err;
120 } 119 }
121 bh = sb_getblk(inode->i_sb, pblock); 120 *bh = sb_getblk(inode->i_sb, pblock);
122 if (!bh) { 121 if (!*bh) {
123 *err = -EIO; 122 err = -EIO;
124 mlog_errno(*err); 123 mlog_errno(err);
125 } 124 }
126 return bh; 125 return err;;
127} 126}
128 127
129/* Read data from global quotafile - avoid pagecache and such because we cannot 128/* 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,
209 err = ocfs2_read_quota_block(gqinode, blk, &bh); 208 err = ocfs2_read_quota_block(gqinode, blk, &bh);
210 ja_type = OCFS2_JOURNAL_ACCESS_WRITE; 209 ja_type = OCFS2_JOURNAL_ACCESS_WRITE;
211 } else { 210 } else {
212 bh = ocfs2_get_quota_block(gqinode, blk, &err); 211 err = ocfs2_get_quota_block(gqinode, blk, &bh);
213 ja_type = OCFS2_JOURNAL_ACCESS_CREATE; 212 ja_type = OCFS2_JOURNAL_ACCESS_CREATE;
214 } 213 }
215 if (err) { 214 if (err) {