Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5876e24 authored by Gao Xiang's avatar Gao Xiang Committed by Greg Kroah-Hartman
Browse files

erofs: use erofs_inode naming

As Christoph suggested [1], "Why is this called vnode instead
of inode?  That seems like a rather odd naming for a Linux
file system."

[1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/


Reported-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-10-gaoxiang25@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1c2dfbf9
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ static int erofs_map_blocks_flatmode(struct inode *inode,
	int err = 0;
	erofs_blk_t nblocks, lastblk;
	u64 offset = map->m_la;
	struct erofs_vnode *vi = EROFS_V(inode);
	struct erofs_inode *vi = EROFS_I(inode);
	bool tailendpacking = (vi->datalayout == EROFS_INODE_FLAT_INLINE);

	trace_erofs_map_blocks_flatmode_enter(inode, map, flags);
@@ -170,7 +170,7 @@ static int erofs_map_blocks_flatmode(struct inode *inode,
int erofs_map_blocks(struct inode *inode,
		     struct erofs_map_blocks *map, int flags)
{
	if (erofs_inode_is_data_compressed(EROFS_V(inode)->datalayout)) {
	if (erofs_inode_is_data_compressed(EROFS_I(inode)->datalayout)) {
		int err = z_erofs_map_blocks_iter(inode, map, flags);

		if (map->mpage) {
@@ -365,7 +365,7 @@ static int erofs_raw_access_readpages(struct file *filp,
			if (IS_ERR(bio)) {
				pr_err("%s, readahead error at page %lu of nid %llu\n",
				       __func__, page->index,
				       EROFS_V(mapping->host)->nid);
				       EROFS_I(mapping->host)->nid);

				bio = NULL;
			}
@@ -404,7 +404,7 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block)
{
	struct inode *inode = mapping->host;

	if (EROFS_V(inode)->datalayout == EROFS_INODE_FLAT_INLINE) {
	if (EROFS_I(inode)->datalayout == EROFS_INODE_FLAT_INLINE) {
		erofs_blk_t blks = i_size_read(inode) >> LOG_BLOCK_SIZE;

		if (block >> LOG_SECTORS_PER_BLOCK >= blks)
+3 −3
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ static int erofs_fill_dentries(struct inode *dir, struct dir_context *ctx,
		/* a corrupted entry is found */
		if (nameoff + de_namelen > maxsize ||
		    de_namelen > EROFS_NAME_LEN) {
			errln("bogus dirent @ nid %llu", EROFS_V(dir)->nid);
			errln("bogus dirent @ nid %llu", EROFS_I(dir)->nid);
			DBG_BUGON(1);
			return -EFSCORRUPTED;
		}
@@ -85,7 +85,7 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
			break;
		} else if (IS_ERR(dentry_page)) {
			errln("fail to readdir of logical block %u of nid %llu",
			      i, EROFS_V(dir)->nid);
			      i, EROFS_I(dir)->nid);
			err = -EFSCORRUPTED;
			break;
		}
@@ -97,7 +97,7 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
		if (nameoff < sizeof(struct erofs_dirent) ||
		    nameoff >= PAGE_SIZE) {
			errln("%s, invalid de[0].nameoff %u @ nid %llu",
			      __func__, nameoff, EROFS_V(dir)->nid);
			      __func__, nameoff, EROFS_I(dir)->nid);
			err = -EFSCORRUPTED;
			goto skip_this;
		}
+6 −6
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
/* no locking */
static int read_inode(struct inode *inode, void *data)
{
	struct erofs_vnode *vi = EROFS_V(inode);
	struct erofs_inode *vi = EROFS_I(inode);
	struct erofs_inode_compact *dic = data;
	struct erofs_inode_extended *die;

@@ -140,7 +140,7 @@ static int read_inode(struct inode *inode, void *data)
static int fill_inline_data(struct inode *inode, void *data,
			    unsigned int m_pofs)
{
	struct erofs_vnode *vi = EROFS_V(inode);
	struct erofs_inode *vi = EROFS_I(inode);
	struct erofs_sb_info *sbi = EROFS_I_SB(inode);

	/* should be tail-packing data inline */
@@ -178,7 +178,7 @@ static int fill_inline_data(struct inode *inode, void *data,
static int fill_inode(struct inode *inode, int isdir)
{
	struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
	struct erofs_vnode *vi = EROFS_V(inode);
	struct erofs_inode *vi = EROFS_I(inode);
	struct page *page;
	void *data;
	int err;
@@ -260,7 +260,7 @@ static int erofs_ilookup_test_actor(struct inode *inode, void *opaque)
{
	const erofs_nid_t nid = *(erofs_nid_t *)opaque;

	return EROFS_V(inode)->nid == nid;
	return EROFS_I(inode)->nid == nid;
}

static int erofs_iget_set_actor(struct inode *inode, void *opaque)
@@ -297,7 +297,7 @@ struct inode *erofs_iget(struct super_block *sb,

	if (inode->i_state & I_NEW) {
		int err;
		struct erofs_vnode *vi = EROFS_V(inode);
		struct erofs_inode *vi = EROFS_I(inode);

		vi->nid = nid;

@@ -317,7 +317,7 @@ int erofs_getattr(const struct path *path, struct kstat *stat,
{
	struct inode *const inode = d_inode(path->dentry);

	if (erofs_inode_is_data_compressed(EROFS_V(inode)->datalayout))
	if (erofs_inode_is_data_compressed(EROFS_I(inode)->datalayout))
		stat->attributes |= STATX_ATTR_COMPRESSED;

	stat->attributes |= STATX_ATTR_IMMUTABLE;
+7 −7
Original line number Diff line number Diff line
@@ -272,14 +272,14 @@ static inline erofs_off_t iloc(struct erofs_sb_info *sbi, erofs_nid_t nid)
}

/* atomic flag definitions */
#define EROFS_V_EA_INITED_BIT	0
#define EROFS_V_Z_INITED_BIT	1
#define EROFS_I_EA_INITED_BIT	0
#define EROFS_I_Z_INITED_BIT	1

/* bitlock definitions (arranged in reverse order) */
#define EROFS_V_BL_XATTR_BIT	(BITS_PER_LONG - 1)
#define EROFS_V_BL_Z_BIT	(BITS_PER_LONG - 2)
#define EROFS_I_BL_XATTR_BIT	(BITS_PER_LONG - 1)
#define EROFS_I_BL_Z_BIT	(BITS_PER_LONG - 2)

struct erofs_vnode {
struct erofs_inode {
	erofs_nid_t nid;

	/* atomic flags (including bitlocks) */
@@ -307,8 +307,8 @@ struct erofs_vnode {
	struct inode vfs_inode;
};

#define EROFS_V(ptr)	\
	container_of(ptr, struct erofs_vnode, vfs_inode)
#define EROFS_I(ptr)	\
	container_of(ptr, struct erofs_inode, vfs_inode)

static inline unsigned long inode_datablocks(struct inode *inode)
{
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ static struct page *find_target_block_classic(struct inode *dir,
				kunmap_atomic(de);
				put_page(page);
				errln("corrupted dir block %d @ nid %llu",
				      mid, EROFS_V(dir)->nid);
				      mid, EROFS_I(dir)->nid);
				DBG_BUGON(1);
				page = ERR_PTR(-EFSCORRUPTED);
				goto out;
Loading