Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125847
b: refs/heads/master
c: af09e51
h: refs/heads/master
i:
  125845: 13c7fb6
  125843: 61e1db3
  125839: d838ccf
v: v3
  • Loading branch information
Jan Kara authored and Mark Fasheh committed Jan 5, 2009
1 parent 532466e commit 51382c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85eb8b73d66530bb7b931789ae7a5ec9744eed34
refs/heads/master: af09e51b6810d3408db1c0e956b3b0687b0e3723
28 changes: 12 additions & 16 deletions trunk/fs/ocfs2/quota_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type,
struct inode *gqinode = oinfo->dqi_gqinode;
int offset = off & (sb->s_blocksize - 1);
sector_t blk = off >> sb->s_blocksize_bits;
int err = 0, new = 0;
int err = 0, new = 0, ja_type;
struct buffer_head *bh = NULL;
handle_t *handle = journal_current_handle();

Expand Down Expand Up @@ -207,32 +207,28 @@ ssize_t ocfs2_quota_write(struct super_block *sb, int type,
if ((offset || len < sb->s_blocksize - OCFS2_QBLK_RESERVED_SPACE) &&
!new) {
err = ocfs2_read_quota_block(gqinode, blk, &bh);
if (err) {
mlog_errno(err);
return err;
}
err = ocfs2_journal_access(handle, gqinode, bh,
OCFS2_JOURNAL_ACCESS_WRITE);
ja_type = OCFS2_JOURNAL_ACCESS_WRITE;
} else {
bh = ocfs2_get_quota_block(gqinode, blk, &err);
if (!bh) {
mlog_errno(err);
return err;
}
err = ocfs2_journal_access(handle, gqinode, bh,
OCFS2_JOURNAL_ACCESS_CREATE);
ja_type = OCFS2_JOURNAL_ACCESS_CREATE;
}
if (err < 0) {
brelse(bh);
goto out;
if (err) {
mlog_errno(err);
return err;
}
lock_buffer(bh);
if (new)
memset(bh->b_data, 0, sb->s_blocksize);
memcpy(bh->b_data + offset, data, len);
flush_dcache_page(bh->b_page);
set_buffer_uptodate(bh);
unlock_buffer(bh);
ocfs2_set_buffer_uptodate(gqinode, bh);
err = ocfs2_journal_access(handle, gqinode, bh, ja_type);
if (err < 0) {
brelse(bh);
goto out;
}
err = ocfs2_journal_dirty(handle, bh);
brelse(bh);
if (err < 0)
Expand Down

0 comments on commit 51382c7

Please sign in to comment.