All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Jianan <jnhuang95@gmail.com>
To: linux-erofs@lists.ozlabs.org
Cc: guoweichao@oppo.com, zhangshiming@oppo.com
Subject: [PATCH 1/5] erofs-utils: fix the conflict with the master branch
Date: Thu, 15 Oct 2020 21:39:55 +0800	[thread overview]
Message-ID: <20201015133959.61007-1-huangjianan@oppo.com> (raw)

The current fuse branch is quite different from the master branch.
So fix the conflict with the master branch to support the upcoming patch.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Signed-off-by: Guo Weichao <guoweichao@oppo.com>
---
 fuse/init.c              |  4 ++--
 fuse/namei.c             | 16 ++++++++--------
 fuse/read.c              |  6 +++---
 fuse/readir.c            |  4 ++--
 include/erofs/internal.h |  6 +++---
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/fuse/init.c b/fuse/init.c
index 885705f..8198fa7 100644
--- a/fuse/init.c
+++ b/fuse/init.c
@@ -41,7 +41,7 @@ int erofs_init_super(void)
 	}
 
 	sbk->checksum = le32_to_cpu(sb->checksum);
-	sbk->features = le32_to_cpu(sb->features);
+	sbk->feature_compat = le32_to_cpu(sb->feature_compat);
 	sbk->blkszbits = sb->blkszbits;
 	ASSERT(sbk->blkszbits != 32);
 
@@ -56,7 +56,7 @@ int erofs_init_super(void)
 	sbk->root_nid = le16_to_cpu(sb->root_nid);
 
 	logp("%-15s:0x%X", STR(magic), SUPER_MEM(magic));
-	logp("%-15s:0x%X", STR(features), SUPER_MEM(features));
+	logp("%-15s:0x%X", STR(feature_compat), SUPER_MEM(feature_compat));
 	logp("%-15s:%u",   STR(blkszbits), SUPER_MEM(blkszbits));
 	logp("%-15s:%u",   STR(root_nid), SUPER_MEM(root_nid));
 	logp("%-15s:%ul",  STR(inos), SUPER_MEM(inos));
diff --git a/fuse/namei.c b/fuse/namei.c
index ab497e8..ded9207 100644
--- a/fuse/namei.c
+++ b/fuse/namei.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-fuse\inode.c
+ * erofs-fuse\namei.c
  * Created by Li Guifu <blucerlee@gmail.com>
  */
 
@@ -43,7 +43,7 @@ int erofs_iget_by_nid(erofs_nid_t nid, struct erofs_vnode *vi)
 {
 	int ret;
 	char buf[EROFS_BLKSIZ];
-	struct erofs_inode_v1 *v1;
+	struct erofs_inode_compact *v1;
 	const erofs_off_t addr = nid2addr(nid);
 	const size_t size = EROFS_BLKSIZ - erofs_blkoff(addr);
 
@@ -51,10 +51,10 @@ int erofs_iget_by_nid(erofs_nid_t nid, struct erofs_vnode *vi)
 	if (ret != (int)size)
 		return -EIO;
 
-	v1 = (struct erofs_inode_v1 *)buf;
-	vi->data_mapping_mode = __inode_data_mapping(le16_to_cpu(v1->i_advise));
-	vi->inode_isize = sizeof(struct erofs_inode_v1);
-	vi->xattr_isize = ondisk_xattr_ibody_size(v1->i_xattr_icount);
+	v1 = (struct erofs_inode_compact *)buf;
+	vi->datalayout = __inode_data_mapping(le16_to_cpu(v1->i_format));
+	vi->inode_isize = sizeof(struct erofs_inode_compact);
+	vi->xattr_isize = erofs_xattr_ibody_size(v1->i_xattr_icount);
 	vi->i_size = le32_to_cpu(v1->i_size);
 	vi->i_mode = le16_to_cpu(v1->i_mode);
 	vi->i_uid = le16_to_cpu(v1->i_uid);
@@ -153,10 +153,10 @@ struct dcache_entry *disk_lookup(struct dcache_entry *parent, const char *name,
 		++nr_cnt;
 	}
 
-	if (v.data_mapping_mode == EROFS_INODE_FLAT_INLINE) {
+	if (v.datalayout == EROFS_INODE_FLAT_INLINE) {
 		uint32_t dir_off = erofs_blkoff(dirsize);
 		off_t dir_addr = nid2addr(dcache_get_nid(parent))
-			+ sizeof(struct erofs_inode_v1);
+			+ sizeof(struct erofs_inode_compact);
 
 		memset(buf, 0, sizeof(buf));
 		ret = dev_read(buf, dir_off, dir_addr);
diff --git a/fuse/read.c b/fuse/read.c
index b2bfbd3..ffe976e 100644
--- a/fuse/read.c
+++ b/fuse/read.c
@@ -64,7 +64,7 @@ size_t erofs_read_data_inline(struct erofs_vnode *vnode, char *buffer,
 	if (!suminline)
 		goto finished;
 
-	addr = nid2addr(vnode->nid) + sizeof(struct erofs_inode_v1)
+	addr = nid2addr(vnode->nid) + sizeof(struct erofs_inode_compact)
 		+ vnode->xattr_isize;
 	ret = dev_read(buffer + rdsz, suminline, addr);
 	if (ret < 0 || (size_t)ret != suminline)
@@ -97,8 +97,8 @@ int erofs_read(const char *path, char *buffer, size_t size, off_t offset,
 	if (ret)
 		return ret;
 
-	logi("path:%s nid=%llu mode=%u", path, nid, v.data_mapping_mode);
-	switch (v.data_mapping_mode) {
+	logi("path:%s nid=%llu mode=%u", path, nid, v.datalayout);
+	switch (v.datalayout) {
 	case EROFS_INODE_FLAT_PLAIN:
 		return erofs_read_data(&v, buffer, size, offset);
 
diff --git a/fuse/readir.c b/fuse/readir.c
index 7fc69f4..367f935 100644
--- a/fuse/readir.c
+++ b/fuse/readir.c
@@ -103,10 +103,10 @@ int erofs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
 		++nr_cnt;
 	}
 
-	if (v.data_mapping_mode == EROFS_INODE_FLAT_INLINE) {
+	if (v.datalayout == EROFS_INODE_FLAT_INLINE) {
 		off_t addr;
 
-		addr = nid2addr(nid) + sizeof(struct erofs_inode_v1)
+		addr = nid2addr(nid) + sizeof(struct erofs_inode_compact)
 			+ v.xattr_isize;
 
 		memset(dirsbuf, 0, sizeof(dirsbuf));
diff --git a/include/erofs/internal.h b/include/erofs/internal.h
index 2316d01..cba3ce4 100644
--- a/include/erofs/internal.h
+++ b/include/erofs/internal.h
@@ -135,7 +135,7 @@ struct erofs_inode {
 };
 
 struct erofs_vnode {
-	uint8_t data_mapping_mode;
+	uint8_t datalayout;
 
 	uint32_t i_size;
 	/* inline size in bytes */
@@ -171,8 +171,8 @@ static inline bool is_inode_layout_compression(struct erofs_inode *inode)
 			EROFS_I_VERSION_BITS)
 
 #define __inode_data_mapping(advise)	\
-	__inode_advise(advise, EROFS_I_DATA_MAPPING_BIT,\
-		EROFS_I_DATA_MAPPING_BITS)
+	__inode_advise(advise, EROFS_I_DATALAYOUT_BIT,\
+		EROFS_I_DATALAYOUT_BITS)
 
 #define IS_ROOT(x)	((x) == (x)->i_parent)
 
-- 
2.25.1


             reply	other threads:[~2020-10-15 13:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 13:39 Huang Jianan [this message]
2020-10-15 13:39 ` [PATCH 2/5] erofs-utils: fix the wrong name length of tail file in the directory Huang Jianan
2020-10-15 13:39 ` [PATCH 3/5] erofs-utils: fix the wrong address of inline dir content Huang Jianan
2020-10-16 15:36   ` Gao Xiang via Linux-erofs
2020-10-15 13:39 ` [PATCH 4/5] erofs-utils: support read special file Huang Jianan
2020-10-15 13:39 ` [PATCH 5/5] erofs-utils: support read compressed file Huang Jianan
2020-10-16 16:17   ` Gao Xiang via Linux-erofs
2020-10-17  6:24     ` jnhuang95
2020-10-17  6:36       ` Gao Xiang via Linux-erofs
2020-10-16 15:41 ` [PATCH 1/5] erofs-utils: fix the conflict with the master branch Gao Xiang via Linux-erofs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015133959.61007-1-huangjianan@oppo.com \
    --to=jnhuang95@gmail.com \
    --cc=guoweichao@oppo.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=zhangshiming@oppo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.