Skip to contentSkip to conversation

include/linux/dcache.h: fix warning in doc comment

PATCH In review Nik Bune 2 participants 2 messages Sep 26, 2023

lore
Share & tools
lore

Nik Bune

author
#0 lore raw

PATCH 1/1 include/linux/dcache.h: fix warning in doc comment

When run make htmldocs there is a warning appears
./include/linux/dcache.h:311: warning: expecting prototype for dget, dget_dlock(). Prototype was for dget_dlock() instead

The comment over the dget_dlock function describes both dget_dlock and dget functions. dget goes right after dget_dlock.

Removed "dget" from dget_dlock function comment.
Copied the same block to the dget function below.

---
 include/linux/dcache.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
include/linux/dcache.h +9 -1
index 6b351e009f59..47adb8dda4a9 100644
@@ -300,7 +300,7 @@ extern char *dentry_path(const struct dentry *, char *, int);
 /* Allocation counts.. */
 
 /**
- *	dget, dget_dlock -	get a reference to a dentry
+ *	dget_dlock -	get a reference to a dentry
  *	@dentry: dentry to get a reference to
  *
  *	Given a dentry or %NULL pointer increment the reference count
@@ -314,6 +314,14 @@ static inline struct dentry *dget_dlock(struct dentry *dentry)
 	return dentry;
 }
 
+/**
+ *	dget -	get a reference to a dentry
+ *	@dentry: dentry to get a reference to
+ *
+ *	Given a dentry or %NULL pointer increment the reference count
+ *	if appropriate and return the dentry. A dentry will not be 
+ *	destroyed when it has references.
+ */
 static inline struct dentry *dget(struct dentry *dentry)
 {
 	if (dentry)
Signature · 1 line
2.34.1
#1 lore raw

Hi,

[adding VFS folks]

Quoted 10 lines · Nik Bune

When run make htmldocs there is a warning appears
./include/linux/dcache.h:311: warning: expecting prototype for dget, dget_dlock(). Prototype was for dget_dlock() instead

The comment over the dget_dlock function describes both dget_dlock and dget functions. dget goes right after dget_dlock.

Removed "dget" from dget_dlock function comment.
Copied the same block to the dget function below.

I was working on this one also, but yours is good as far as it goes.

I was trying to differentiate between dget() and dget_dlock(). Something simple and short, like:

in get():

dget() is used for the initial lockref on a dentry.

and in dget_dlock():

dget_dlock() is used to increment the lockref count after the initial lockref is made.

but I don't know how correct those comments are or how they should be improved. :(

Quoted 32 lines
---
 include/linux/dcache.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
include/linux/dcache.h +9 -1
index 6b351e009f59..47adb8dda4a9 100644
@@ -300,7 +300,7 @@ extern char *dentry_path(const struct dentry *, char *, int);
 /* Allocation counts.. */
 
 /**
- *	dget, dget_dlock -	get a reference to a dentry
+ *	dget_dlock -	get a reference to a dentry
  *	@dentry: dentry to get a reference to
  *
  *	Given a dentry or %NULL pointer increment the reference count
@@ -314,6 +314,14 @@ static inline struct dentry *dget_dlock(struct dentry *dentry)
 	return dentry;
 }
 
+/**
+ *	dget -	get a reference to a dentry
+ *	@dentry: dentry to get a reference to
+ *
+ *	Given a dentry or %NULL pointer increment the reference count
+ *	if appropriate and return the dentry. A dentry will not be 
+ *	destroyed when it has references.
+ */
 static inline struct dentry *dget(struct dentry *dentry)
 {
 	if (dentry)
Signature · 1 line
~Randy