public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: Add function declaration of simple_dname
@ 2020-08-19  8:32 Leon Romanovsky
  2020-08-19 11:34 ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Leon Romanovsky @ 2020-08-19  8:32 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Leon Romanovsky, linux-fsdevel, linux-kernel

From: Leon Romanovsky <leonro@nvidia.com>

The simple_dname() is declared in internal header file as extern
and this generates the following GCC warning.

fs/d_path.c:311:7: warning: no previous prototype for 'simple_dname' [-Wmissing-prototypes]
  311 | char *simple_dname(struct dentry *dentry, char *buffer, int buflen)
      |       ^~~~~~~~~~~~

Instead of that extern, reuse the fact that internal.h file is internal to fs/* and
declare simple_dname() like any other function.

Fixes: 7e5f7bb08b8c ("unexport simple_dname()")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 fs/d_path.c   | 2 ++
 fs/internal.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/d_path.c b/fs/d_path.c
index 0f1fc1743302..4b89448cc78e 100644
--- a/fs/d_path.c
+++ b/fs/d_path.c
@@ -8,6 +8,8 @@
 #include <linux/prefetch.h>
 #include "mount.h"

+#include "internal.h"
+
 static int prepend(char **buffer, int *buflen, const char *str, int namelen)
 {
 	*buflen -= namelen;
diff --git a/fs/internal.h b/fs/internal.h
index 10517ece4516..2def264272f4 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -164,7 +164,7 @@ extern int d_set_mounted(struct dentry *dentry);
 extern long prune_dcache_sb(struct super_block *sb, struct shrink_control *sc);
 extern struct dentry *d_alloc_cursor(struct dentry *);
 extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
-extern char *simple_dname(struct dentry *, char *, int);
+char *simple_dname(struct dentry *d, char *buf, int len);
 extern void dput_to_list(struct dentry *, struct list_head *);
 extern void shrink_dentry_list(struct list_head *);

--
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-19 12:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-19  8:32 [PATCH] fs: Add function declaration of simple_dname Leon Romanovsky
2020-08-19 11:34 ` Matthew Wilcox
2020-08-19 11:40   ` Leon Romanovsky
2020-08-19 11:47     ` Matthew Wilcox
2020-08-19 11:58       ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox