diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-26 14:45:42 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-26 14:45:42 -0800 |
commit | d49981150387c481779a544ec641f17882f4bbfb (patch) | |
tree | 02661a89635bd191b069f546b97d5cd3c63f2426 /fs/ocfs2/alloc.c | |
parent | 392b8e47bada8a1068ab0c0bdc44c58726dc395b (diff) | |
parent | 28d57d437786eb3e44f1ca3f0f41e7cfe29c6dd4 (diff) |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
ocfs2: add IO error check in ocfs2_get_sector()
ocfs2: set gap to seperate entry and value when xattr in bucket
ocfs2: lock the metaecc process for xattr bucket
ocfs2: Use the right access_* method in ctime update of xattr.
ocfs2/dlm: Make dlm_assert_master_handler() kill itself instead of the asserter
ocfs2/dlm: Use ast_lock to protect ast_list
ocfs2: Cleanup the lockname print in dlmglue.c
ocfs2/dlm: Retract fix for race between purge and migrate
ocfs2: Access and dirty the buffer_head in mark_written.
Diffstat (limited to 'fs/ocfs2/alloc.c')
-rw-r--r-- | fs/ocfs2/alloc.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 60fe74035db5..3a9e5deed74d 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -4796,6 +4796,29 @@ out: return ret; } +static int ocfs2_replace_extent_rec(struct inode *inode, + handle_t *handle, + struct ocfs2_path *path, + struct ocfs2_extent_list *el, + int split_index, + struct ocfs2_extent_rec *split_rec) +{ + int ret; + + ret = ocfs2_path_bh_journal_access(handle, inode, path, + path_num_items(path) - 1); + if (ret) { + mlog_errno(ret); + goto out; + } + + el->l_recs[split_index] = *split_rec; + + ocfs2_journal_dirty(handle, path_leaf_bh(path)); +out: + return ret; +} + /* * Mark part or all of the extent record at split_index in the leaf * pointed to by path as written. This removes the unwritten @@ -4885,7 +4908,9 @@ static int __ocfs2_mark_extent_written(struct inode *inode, if (ctxt.c_contig_type == CONTIG_NONE) { if (ctxt.c_split_covers_rec) - el->l_recs[split_index] = *split_rec; + ret = ocfs2_replace_extent_rec(inode, handle, + path, el, + split_index, split_rec); else ret = ocfs2_split_and_insert(inode, handle, path, et, &last_eb_bh, split_index, |