diff options
author | Tao Ma <boyu.mt@taobao.com> | 2012-12-10 14:05:57 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-12-10 14:05:57 -0500 |
commit | 3fdcfb668fd78ec92d9bc2daddf1d41e2a8a30bb (patch) | |
tree | 7f6a45d4815824132c0d70906e04a937a2a222bf /fs/ext4/inline.c | |
parent | f19d5870cbf72d4cb2a8e1f749dff97af99b071e (diff) |
ext4: add journalled write support for inline data
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inline.c')
-rw-r--r-- | fs/ext4/inline.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 320ff6fe5d8c..01274b1e7d40 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c | |||
@@ -747,6 +747,30 @@ out: | |||
747 | return copied; | 747 | return copied; |
748 | } | 748 | } |
749 | 749 | ||
750 | struct buffer_head * | ||
751 | ext4_journalled_write_inline_data(struct inode *inode, | ||
752 | unsigned len, | ||
753 | struct page *page) | ||
754 | { | ||
755 | int ret; | ||
756 | void *kaddr; | ||
757 | struct ext4_iloc iloc; | ||
758 | |||
759 | ret = ext4_get_inode_loc(inode, &iloc); | ||
760 | if (ret) { | ||
761 | ext4_std_error(inode->i_sb, ret); | ||
762 | return NULL; | ||
763 | } | ||
764 | |||
765 | down_write(&EXT4_I(inode)->xattr_sem); | ||
766 | kaddr = kmap_atomic(page); | ||
767 | ext4_write_inline_data(inode, &iloc, kaddr, 0, len); | ||
768 | kunmap_atomic(kaddr); | ||
769 | up_write(&EXT4_I(inode)->xattr_sem); | ||
770 | |||
771 | return iloc.bh; | ||
772 | } | ||
773 | |||
750 | 774 | ||
751 | int ext4_destroy_inline_data(handle_t *handle, struct inode *inode) | 775 | int ext4_destroy_inline_data(handle_t *handle, struct inode *inode) |
752 | { | 776 | { |