linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <mszeredi@redhat.com>
To: linux-unionfs@vger.kernel.org
Cc: Amir Goldstein <amir73il@gmail.com>, linux-fsdevel@vger.kernel.org
Subject: [PATCH 4/4] ovl: clean up struct ovl_dir_cache use outside readdir.c
Date: Thu,  7 Mar 2024 12:02:08 +0100	[thread overview]
Message-ID: <20240307110217.203064-4-mszeredi@redhat.com> (raw)
In-Reply-To: <20240307110217.203064-1-mszeredi@redhat.com>

Remove unnecessary forward declaration in super.c and move helper functions
that are only used inside readdir.c

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
---
 fs/overlayfs/overlayfs.h |  2 --
 fs/overlayfs/readdir.c   | 10 ++++++++++
 fs/overlayfs/super.c     |  2 --
 fs/overlayfs/util.c      | 10 ----------
 4 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index ee949f3e7c77..167dc37f804c 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -470,8 +470,6 @@ struct inode *ovl_inode_lowerdata(struct inode *inode);
 struct inode *ovl_inode_real(struct inode *inode);
 struct inode *ovl_inode_realdata(struct inode *inode);
 const char *ovl_lowerdata_redirect(struct inode *inode);
-struct ovl_dir_cache *ovl_dir_cache(struct inode *inode);
-void ovl_set_dir_cache(struct inode *inode, struct ovl_dir_cache *cache);
 void ovl_dentry_set_flag(unsigned long flag, struct dentry *dentry);
 void ovl_dentry_clear_flag(unsigned long flag, struct dentry *dentry);
 bool ovl_dentry_test_flag(unsigned long flag, struct dentry *dentry);
diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
index b98e0d17f40e..4a20a44b34f2 100644
--- a/fs/overlayfs/readdir.c
+++ b/fs/overlayfs/readdir.c
@@ -61,6 +61,16 @@ struct ovl_dir_file {
 	struct file *upperfile;
 };
 
+static struct ovl_dir_cache *ovl_dir_cache(struct inode *inode)
+{
+	return inode && S_ISDIR(inode->i_mode) ? OVL_I(inode)->cache : NULL;
+}
+
+static void ovl_set_dir_cache(struct inode *inode, struct ovl_dir_cache *cache)
+{
+	OVL_I(inode)->cache = cache;
+}
+
 static struct ovl_cache_entry *ovl_cache_entry_from_node(struct rb_node *n)
 {
 	return rb_entry(n, struct ovl_cache_entry, node);
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 2eef6c70b2ae..2413d3107335 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -26,8 +26,6 @@ MODULE_DESCRIPTION("Overlay filesystem");
 MODULE_LICENSE("GPL");
 
 
-struct ovl_dir_cache;
-
 static struct dentry *ovl_d_real(struct dentry *dentry,
 				 const struct inode *inode)
 {
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index a8e17f14d7a2..cfe625717c47 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -421,16 +421,6 @@ const char *ovl_lowerdata_redirect(struct inode *inode)
 		OVL_I(inode)->lowerdata_redirect : NULL;
 }
 
-struct ovl_dir_cache *ovl_dir_cache(struct inode *inode)
-{
-	return inode && S_ISDIR(inode->i_mode) ? OVL_I(inode)->cache : NULL;
-}
-
-void ovl_set_dir_cache(struct inode *inode, struct ovl_dir_cache *cache)
-{
-	OVL_I(inode)->cache = cache;
-}
-
 void ovl_dentry_set_flag(unsigned long flag, struct dentry *dentry)
 {
 	set_bit(flag, OVL_E_FLAGS(dentry));
-- 
2.44.0


      parent reply	other threads:[~2024-03-07 11:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 11:02 [PATCH 1/4] ovl: use refcount_t in readdir Miklos Szeredi
2024-03-07 11:02 ` [PATCH 2/4] ovl: get rid of iterate wrapper Miklos Szeredi
2024-03-07 11:02 ` [PATCH 3/4] ovl: only lock readdir for accessing the cache Miklos Szeredi
2024-03-07 13:11   ` Amir Goldstein
2024-03-07 14:09     ` Miklos Szeredi
2024-03-07 16:13       ` Miklos Szeredi
2024-03-07 17:31         ` Amir Goldstein
2024-03-11 13:52           ` Christian Brauner
2024-03-07 11:02 ` Miklos Szeredi [this message]

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=20240307110217.203064-4-mszeredi@redhat.com \
    --to=mszeredi@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).