Skip to contentSkip to conversation

fs: use helper function file_inode() to get inode

PATCH New Chen Xiao 1 participant 1 message Dec 6, 2022 VFS

lore
Share & tools
lore

Chen Xiao

author
#0 lore raw

PATCH 1/1 fs: use helper function file_inode() to get inode

Commit 496ad9aa8ef44 ("new helper: file_inode(file)") introduced the helper file_inode(file) but dir_emit_dot forgot to use it.

---
 include/linux/fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/fs.h +1 -1
index 59ae95d..014aef9 100644
@@ -3567,7 +3567,7 @@ static inline bool dir_emit(struct dir_context *ctx,
 static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx)
 {
 	return ctx->actor(ctx, ".", 1, ctx->pos,
-			  file->f_path.dentry->d_inode->i_ino, DT_DIR);
+			  file_inode(file)->i_ino, DT_DIR);
 }
 static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx)
 {
Signature · 1 line
1.8.3.1