Skip to contentSkip to conversation

Task: Extra credit : LKMP Bug Fixing 2024 Spring : Documentation

PATCH In review Abhinav Jain 2 participants 2 messages Feb 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Task: Extra credit : LKMP Bug Fixing 2024 Spring : Documentation

Added a prototype for dget() to fix the warning

---
 include/linux/dcache.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
include/linux/dcache.h +8 -1
index 3da2f0545d5d..b082b48e7eb5 100644
@@ -301,7 +301,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
@@ -315,6 +315,13 @@ 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
+ *	unconditionally and return it.
+ */
 static inline struct dentry *dget(struct dentry *dentry)
 {
 	if (dentry)
Signature · 1 line
2.25.1
#1 lore raw

Hi--

Quoted 24 lines · Abhinav Jain

Added a prototype for dget() to fix the warning

---
 include/linux/dcache.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
include/linux/dcache.h +1 -1
index 3da2f0545d5d..b082b48e7eb5 100644
@@ -301,7 +301,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
@@ -315,6 +315,13 @@ static inline struct dentry *dget_dlock(struct dentry *dentry)
 	return dentry;
 }
 

include/linux/dcache.h static inline struct dentry *dget_dlock(struct dentry *dentry) · line 327

Quoted 10 lines
include/linux/dcache.h +7 -0
+/**
+ *	dget -	get a reference to a dentry
+ *	@dentry: dentry to get a reference to
+ *
+ *	Given a dentry or %NULL pointer increment the reference count
+ *	unconditionally and return it.
+ */
 static inline struct dentry *dget(struct dentry *dentry)
 {
 	if (dentry)

The function documentation now makes it look like these functions do the same thing, so why have both of them -- or am I misreading it?

Anyway, this problem is already fixed in the linux-next tree (more specifically in the vfs tree).

Thanks.

Signature · 1 line
#Randy