From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] fs: drop f_dentry
Date: Wed, 25 Jun 2025 10:35:44 +0200 [thread overview]
Message-ID: <20250625083544.2660810-1-s.hauer@pengutronix.de> (raw)
Defining f_dentry f_path.dentry is confusing as it suggests that a
struct member f_dentry is modified that doesn't exist and furthermore
it suggests that the f_path member is not modified. Drop the define
and replace its usage with f_path.dentry directly. While at it remove
the unused define f_vfsmnt.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
fs/9p/vfs_file.c | 2 +-
fs/9p/vfs_inode_dotl.c | 2 +-
fs/fs.c | 4 ++--
fs/legacy.c | 2 +-
fs/tftp.c | 2 +-
include/linux/fs.h | 2 --
6 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index 2a44a77326..f99f7f294b 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -44,7 +44,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
fid = file->private_data;
if (!fid) {
- fid = v9fs_fid_clone(file->f_dentry);
+ fid = v9fs_fid_clone(file->f_path.dentry);
if (IS_ERR(fid))
return PTR_ERR(fid);
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 2eb3cc9274..46fc858eae 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -319,7 +319,7 @@ v9fs_truncate(struct device *dev, struct file *f, loff_t size)
.ia_file = f,
};
- return v9fs_vfs_setattr_dotl(f->f_dentry, &iattr);
+ return v9fs_vfs_setattr_dotl(f->f_path.dentry, &iattr);
}
/**
diff --git a/fs/fs.c b/fs/fs.c
index 3580bff6f5..3d7bea3a63 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -2243,7 +2243,7 @@ static const char *path_init(int dirfd, struct nameidata *nd, unsigned flags)
return ERR_CAST(f);
nd->path.mnt = &f->fsdev->vfsmount;
- nd->path.dentry = f->f_dentry;
+ nd->path.dentry = f->f_path.dentry;
follow_mount(&nd->path);
if (*s == '/')
@@ -2590,7 +2590,7 @@ int openat(int dirfd, const char *pathname, int flags)
}
f->path = NULL;
- f->f_dentry = NULL;
+ f->f_path.dentry = NULL;
f->f_inode = new_inode(&fsdev->sb);
f->f_inode->i_mode = S_IFREG;
f->f_flags = flags;
diff --git a/fs/legacy.c b/fs/legacy.c
index f0901ce0d4..5cb4ec22fe 100644
--- a/fs/legacy.c
+++ b/fs/legacy.c
@@ -89,7 +89,7 @@ static int legacy_open(struct inode *inode, struct file *file)
if (!legacy_ops->open)
return 0;
- pathname = dpath(file->f_dentry, fsdev->vfsmount.mnt_root);
+ pathname = dpath(file->f_path.dentry, fsdev->vfsmount.mnt_root);
error = legacy_ops->open(&file->fsdev->dev, file, pathname);
free(pathname);
diff --git a/fs/tftp.c b/fs/tftp.c
index 5cb71431eb..01ebcbfc7a 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -769,7 +769,7 @@ static int tftp_open(struct inode *inode, struct file *file)
{
struct file_priv *priv;
- priv = tftp_do_open(&file->fsdev->dev, file->f_flags, file->f_dentry, false);
+ priv = tftp_do_open(&file->fsdev->dev, file->f_flags, file->f_path.dentry, false);
if (IS_ERR(priv))
return PTR_ERR(priv);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7ae52d476d..55e01d386d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -228,8 +228,6 @@ struct file {
#define FILE_SIZE_STREAM ((loff_t) -1)
#define f_size f_inode->i_size
struct inode *f_inode; /* cached value */
-#define f_dentry f_path.dentry
-#define f_vfsmnt f_path.mnt
const struct file_operations *f_op;
unsigned int f_flags;
loff_t f_pos;
--
2.39.5
reply other threads:[~2025-06-25 9:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250625083544.2660810-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox