Commit 53a7f996 authored by Gao Xiang's avatar Gao Xiang

erofs: clean up unnecessary code and comments

Some conditional macros and comments are useless.

Link: https://lore.kernel.org/r/20220927063607.54832-1-hsiangkao@linux.alibaba.comReviewed-by: default avatarYue Hu <huyue2@coolpad.com>
Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
parent 31da107f
...@@ -196,7 +196,6 @@ enum { ...@@ -196,7 +196,6 @@ enum {
EROFS_ZIP_CACHE_READAROUND EROFS_ZIP_CACHE_READAROUND
}; };
#ifdef CONFIG_EROFS_FS_ZIP
#define EROFS_LOCKED_MAGIC (INT_MIN | 0xE0F510CCL) #define EROFS_LOCKED_MAGIC (INT_MIN | 0xE0F510CCL)
/* basic unit of the workstation of a super_block */ /* basic unit of the workstation of a super_block */
...@@ -236,7 +235,6 @@ static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp) ...@@ -236,7 +235,6 @@ static inline int erofs_wait_on_workgroup_freezed(struct erofs_workgroup *grp)
return atomic_cond_read_relaxed(&grp->refcount, return atomic_cond_read_relaxed(&grp->refcount,
VAL != EROFS_LOCKED_MAGIC); VAL != EROFS_LOCKED_MAGIC);
} }
#endif /* !CONFIG_EROFS_FS_ZIP */
/* we strictly follow PAGE_SIZE and no buffer head yet */ /* we strictly follow PAGE_SIZE and no buffer head yet */
#define LOG_BLOCK_SIZE PAGE_SHIFT #define LOG_BLOCK_SIZE PAGE_SHIFT
......
...@@ -185,7 +185,6 @@ int erofs_namei(struct inode *dir, const struct qstr *name, erofs_nid_t *nid, ...@@ -185,7 +185,6 @@ int erofs_namei(struct inode *dir, const struct qstr *name, erofs_nid_t *nid,
if (IS_ERR(de)) if (IS_ERR(de))
return PTR_ERR(de); return PTR_ERR(de);
/* the target page has been mapped */
if (ndirents) if (ndirents)
de = find_target_dirent(&qn, (u8 *)de, EROFS_BLKSIZ, ndirents); de = find_target_dirent(&qn, (u8 *)de, EROFS_BLKSIZ, ndirents);
...@@ -197,9 +196,7 @@ int erofs_namei(struct inode *dir, const struct qstr *name, erofs_nid_t *nid, ...@@ -197,9 +196,7 @@ int erofs_namei(struct inode *dir, const struct qstr *name, erofs_nid_t *nid,
return PTR_ERR_OR_ZERO(de); return PTR_ERR_OR_ZERO(de);
} }
/* NOTE: i_mutex is already held by vfs */ static struct dentry *erofs_lookup(struct inode *dir, struct dentry *dentry,
static struct dentry *erofs_lookup(struct inode *dir,
struct dentry *dentry,
unsigned int flags) unsigned int flags)
{ {
int err; int err;
...@@ -207,17 +204,11 @@ static struct dentry *erofs_lookup(struct inode *dir, ...@@ -207,17 +204,11 @@ static struct dentry *erofs_lookup(struct inode *dir,
unsigned int d_type; unsigned int d_type;
struct inode *inode; struct inode *inode;
DBG_BUGON(!d_really_is_negative(dentry));
/* dentry must be unhashed in lookup, no need to worry about */
DBG_BUGON(!d_unhashed(dentry));
trace_erofs_lookup(dir, dentry, flags); trace_erofs_lookup(dir, dentry, flags);
/* file name exceeds fs limit */
if (dentry->d_name.len > EROFS_NAME_LEN) if (dentry->d_name.len > EROFS_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG); return ERR_PTR(-ENAMETOOLONG);
/* false uninitialized warnings on gcc 4.8.x */
err = erofs_namei(dir, &dentry->d_name, &nid, &d_type); err = erofs_namei(dir, &dentry->d_name, &nid, &d_type);
if (err == -ENOENT) { if (err == -ENOENT) {
......
...@@ -39,9 +39,7 @@ static inline unsigned int xattrblock_offset(struct erofs_sb_info *sbi, ...@@ -39,9 +39,7 @@ static inline unsigned int xattrblock_offset(struct erofs_sb_info *sbi,
#ifdef CONFIG_EROFS_FS_XATTR #ifdef CONFIG_EROFS_FS_XATTR
extern const struct xattr_handler erofs_xattr_user_handler; extern const struct xattr_handler erofs_xattr_user_handler;
extern const struct xattr_handler erofs_xattr_trusted_handler; extern const struct xattr_handler erofs_xattr_trusted_handler;
#ifdef CONFIG_EROFS_FS_SECURITY
extern const struct xattr_handler erofs_xattr_security_handler; extern const struct xattr_handler erofs_xattr_security_handler;
#endif
static inline const struct xattr_handler *erofs_xattr_handler(unsigned int idx) static inline const struct xattr_handler *erofs_xattr_handler(unsigned int idx)
{ {
......
...@@ -731,8 +731,7 @@ static int z_erofs_do_map_blocks(struct inode *inode, ...@@ -731,8 +731,7 @@ static int z_erofs_do_map_blocks(struct inode *inode,
return err; return err;
} }
int z_erofs_map_blocks_iter(struct inode *inode, int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
struct erofs_map_blocks *map,
int flags) int flags)
{ {
struct erofs_inode *const vi = EROFS_I(inode); struct erofs_inode *const vi = EROFS_I(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment