summaryrefslogtreecommitdiff
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-02-05 17:46:29 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-03-03 09:58:45 -0800
commit0c872e2dedfc09f41a5604d1c5010f800c0bd8f1 (patch)
tree2bc29f27414dc9048b1f1e6b3b88d9571ff9726d /fs/f2fs/f2fs.h
parent3c0d84d6f1dde0a85f20957954fffb209edc55ac (diff)
downloadlwn-0c872e2dedfc09f41a5604d1c5010f800c0bd8f1.tar.gz
lwn-0c872e2dedfc09f41a5604d1c5010f800c0bd8f1.zip
f2fs: move ext_lock out of struct extent_info
Move ext_lock out of struct extent_info, then in the following patches we can use variables with struct extent_info type as a parameter to pass pure data. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index f8da399eb711..c3caa3cb5beb 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -277,7 +277,6 @@ enum {
#define F2FS_MIN_EXTENT_LEN 16 /* minimum extent length */
struct extent_info {
- rwlock_t ext_lock; /* rwlock for consistency */
unsigned int fofs; /* start offset in a file */
u32 blk_addr; /* start block address of the extent */
unsigned int len; /* length of the extent */
@@ -309,6 +308,7 @@ struct f2fs_inode_info {
nid_t i_xattr_nid; /* node id that contains xattrs */
unsigned long long xattr_ver; /* cp version of xattr modification */
struct extent_info ext; /* in-memory extent cache entry */
+ rwlock_t ext_lock; /* rwlock for single extent cache */
struct inode_entry *dirty_dir; /* the pointer of dirty dir */
struct radix_tree_root inmem_root; /* radix tree for inmem pages */
@@ -319,21 +319,17 @@ struct f2fs_inode_info {
static inline void get_extent_info(struct extent_info *ext,
struct f2fs_extent i_ext)
{
- write_lock(&ext->ext_lock);
ext->fofs = le32_to_cpu(i_ext.fofs);
ext->blk_addr = le32_to_cpu(i_ext.blk_addr);
ext->len = le32_to_cpu(i_ext.len);
- write_unlock(&ext->ext_lock);
}
static inline void set_raw_extent(struct extent_info *ext,
struct f2fs_extent *i_ext)
{
- read_lock(&ext->ext_lock);
i_ext->fofs = cpu_to_le32(ext->fofs);
i_ext->blk_addr = cpu_to_le32(ext->blk_addr);
i_ext->len = cpu_to_le32(ext->len);
- read_unlock(&ext->ext_lock);
}
struct f2fs_nm_info {