[PATCH] Task: Extra credit : LKMP Bug Fixing 2024 Spring : Documentation

Abhinav Jain posted 1 patch 2 years ago
include/linux/dcache.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
[PATCH] Task: Extra credit : LKMP Bug Fixing 2024 Spring : Documentation
Posted by Abhinav Jain 2 years ago
Added a prototype for dget() to fix the warning

Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>
---
 include/linux/dcache.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 3da2f0545d5d..b082b48e7eb5 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -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)
-- 
2.25.1
Re: [PATCH] Task: Extra credit : LKMP Bug Fixing 2024 Spring : Documentation
Posted by Randy Dunlap 2 years ago
Hi--

On 2/3/24 05:07, Abhinav Jain wrote:
> Added a prototype for dget() to fix the warning
> 
> Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>
> ---
>  include/linux/dcache.h | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/dcache.h b/include/linux/dcache.h
> index 3da2f0545d5d..b082b48e7eb5 100644
> --- a/include/linux/dcache.h
> +++ b/include/linux/dcache.h
> @@ -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)

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.
-- 
#Randy