A generic for_each_inode() will be added to fs.h which will collide with it. Rename the jffs2 one firstly, so that the generic macro can be introduced without touching this file again. No functional change. Signed-off-by: Huang Shijie --- fs/jffs2/build.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c index 6ae9d6fefb86..0b21c79b0353 100644 --- a/fs/jffs2/build.c +++ b/fs/jffs2/build.c @@ -40,13 +40,13 @@ next_inode(int *i, struct jffs2_inode_cache *ic, struct jffs2_sb_info *c) if (ic->next) return ic->next; (*i)++; return first_inode_chain(i, c); } -#define for_each_inode(i, c, ic) \ +#define for_each_jffs2_inode(i, c, ic) \ for (i = 0, ic = first_inode_chain(&i, (c)); \ ic; \ ic = next_inode(&i, ic, (c))) static void jffs2_build_inode_pass1(struct jffs2_sb_info *c, @@ -117,13 +117,13 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c) dbg_fsbuild("scanned flash completely\n"); jffs2_dbg_dump_block_lists_nolock(c); dbg_fsbuild("pass 1 starting\n"); c->flags |= JFFS2_SB_FLAG_BUILDING; /* Now scan the directory tree, increasing nlink according to every dirent found. */ - for_each_inode(i, c, ic) { + for_each_jffs2_inode(i, c, ic) { if (ic->scan_dents) { jffs2_build_inode_pass1(c, ic, &dir_hardlinks); cond_resched(); } } @@ -133,13 +133,13 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c) they were directories, then decrement the nlink of their children too, and repeat the scan. As that's going to be a fairly uncommon occurrence, it's not so evil to do it this way. Recursion bad. */ dbg_fsbuild("pass 2 starting\n"); - for_each_inode(i, c, ic) { + for_each_jffs2_inode(i, c, ic) { if (ic->pino_nlink) continue; jffs2_build_remove_unlinked_inode(c, ic, &dead_fds); cond_resched(); } @@ -164,21 +164,21 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c) * they are gone now because some of the links were from * dead directories which still had some old dirents lying * around and not yet garbage-collected, but which have * been discarded above. So clear the pino_nlink field * in each directory, so that the final scan below can * print appropriate warnings. */ - for_each_inode(i, c, ic) { + for_each_jffs2_inode(i, c, ic) { if (ic->flags & INO_FLAGS_IS_DIR) ic->pino_nlink = 0; } } dbg_fsbuild("freeing temporary data structures\n"); /* Finally, we can scan again and free the dirent structs */ - for_each_inode(i, c, ic) { + for_each_jffs2_inode(i, c, ic) { while(ic->scan_dents) { fd = ic->scan_dents; ic->scan_dents = fd->next; /* We do use the pino_nlink field to count nlink of * directories during fs build, so set it to the * parent ino# now. Now that there's hopefully only @@ -223,13 +223,13 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c) jffs2_rotate_lists(c); ret = 0; exit: if (ret) { - for_each_inode(i, c, ic) { + for_each_jffs2_inode(i, c, ic) { while(ic->scan_dents) { fd = ic->scan_dents; ic->scan_dents = fd->next; jffs2_free_full_dirent(fd); } } -- 2.34.1