LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFC: 2.6 patch] fs/configfs/ cleanups
@ 2008-02-27 21:20 Adrian Bunk
  2008-02-27 22:36 ` Joel Becker
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2008-02-27 21:20 UTC (permalink / raw)
  To: joel.becker; +Cc: linux-kernel

This patch contains the following cleanups:
- make the needlessly global file.c:configfs_add_file() static
- #if 0 the unused inode.c:configfs_hash_and_remove()

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

This patch has been sent on:
- 17 Feb 2008

 fs/configfs/configfs_internal.h |    3 ---
 fs/configfs/file.c              |    3 ++-
 fs/configfs/inode.c             |    2 ++
 3 files changed, 4 insertions(+), 4 deletions(-)

651b7a33c0dce1790230fe8ba9b7445cd69c8bde diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
index cca9860..378fa36 100644
--- a/fs/configfs/configfs_internal.h
+++ b/fs/configfs/configfs_internal.h
@@ -63,9 +63,6 @@ extern int configfs_create_file(struct config_item *, const struct configfs_attr
 extern int configfs_make_dirent(struct configfs_dirent *,
 				struct dentry *, void *, umode_t, int);
 
-extern int configfs_add_file(struct dentry *, const struct configfs_attribute *, int);
-extern void configfs_hash_and_remove(struct dentry * dir, const char * name);
-
 extern const unsigned char * configfs_get_name(struct configfs_dirent *sd);
 extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent);
 extern int configfs_setattr(struct dentry *dentry, struct iattr *iattr);
diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index 397cb50..f331a40 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -314,7 +314,8 @@ const struct file_operations configfs_file_operations = {
 };
 
 
-int configfs_add_file(struct dentry * dir, const struct configfs_attribute * attr, int type)
+static int configfs_add_file(struct dentry * dir,
+			     const struct configfs_attribute * attr, int type)
 {
 	struct configfs_dirent * parent_sd = dir->d_fsdata;
 	umode_t mode = (attr->ca_mode & S_IALLUGO) | S_IFREG;
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 4c1ebff..dccff59 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -233,6 +233,7 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
 	}
 }
 
+#if 0
 void configfs_hash_and_remove(struct dentry * dir, const char * name)
 {
 	struct configfs_dirent * sd;
@@ -255,6 +256,7 @@ void configfs_hash_and_remove(struct dentry * dir, const char * name)
 	}
 	mutex_unlock(&dir->d_inode->i_mutex);
 }
+#endif  /*  0  */
 
 int __init configfs_inode_init(void)
 {


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

* Re: [RFC: 2.6 patch] fs/configfs/ cleanups
  2008-02-27 21:20 [RFC: 2.6 patch] fs/configfs/ cleanups Adrian Bunk
@ 2008-02-27 22:36 ` Joel Becker
  2008-03-03 18:07   ` [2.6 " Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Becker @ 2008-02-27 22:36 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Wed, Feb 27, 2008 at 11:20:48PM +0200, Adrian Bunk wrote:
> This patch contains the following cleanups:
> - make the needlessly global file.c:configfs_add_file() static
> - #if 0 the unused inode.c:configfs_hash_and_remove()
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Joel Becker <joel.becker@oracle.com>

I'd also take a patch to remove configfs_hash_and_remove().

Joel

> 
> ---
> 
> This patch has been sent on:
> - 17 Feb 2008
> 
>  fs/configfs/configfs_internal.h |    3 ---
>  fs/configfs/file.c              |    3 ++-
>  fs/configfs/inode.c             |    2 ++
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> 651b7a33c0dce1790230fe8ba9b7445cd69c8bde diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
> index cca9860..378fa36 100644
> --- a/fs/configfs/configfs_internal.h
> +++ b/fs/configfs/configfs_internal.h
> @@ -63,9 +63,6 @@ extern int configfs_create_file(struct config_item *, const struct configfs_attr
>  extern int configfs_make_dirent(struct configfs_dirent *,
>  				struct dentry *, void *, umode_t, int);
>  
> -extern int configfs_add_file(struct dentry *, const struct configfs_attribute *, int);
> -extern void configfs_hash_and_remove(struct dentry * dir, const char * name);
> -
>  extern const unsigned char * configfs_get_name(struct configfs_dirent *sd);
>  extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent);
>  extern int configfs_setattr(struct dentry *dentry, struct iattr *iattr);
> diff --git a/fs/configfs/file.c b/fs/configfs/file.c
> index 397cb50..f331a40 100644
> --- a/fs/configfs/file.c
> +++ b/fs/configfs/file.c
> @@ -314,7 +314,8 @@ const struct file_operations configfs_file_operations = {
>  };
>  
>  
> -int configfs_add_file(struct dentry * dir, const struct configfs_attribute * attr, int type)
> +static int configfs_add_file(struct dentry * dir,
> +			     const struct configfs_attribute * attr, int type)
>  {
>  	struct configfs_dirent * parent_sd = dir->d_fsdata;
>  	umode_t mode = (attr->ca_mode & S_IALLUGO) | S_IFREG;
> diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
> index 4c1ebff..dccff59 100644
> --- a/fs/configfs/inode.c
> +++ b/fs/configfs/inode.c
> @@ -233,6 +233,7 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
>  	}
>  }
>  
> +#if 0
>  void configfs_hash_and_remove(struct dentry * dir, const char * name)
>  {
>  	struct configfs_dirent * sd;
> @@ -255,6 +256,7 @@ void configfs_hash_and_remove(struct dentry * dir, const char * name)
>  	}
>  	mutex_unlock(&dir->d_inode->i_mutex);
>  }
> +#endif  /*  0  */
>  
>  int __init configfs_inode_init(void)
>  {
> 

-- 

"Every day I get up and look through the Forbes list of the richest
 people in America. If I'm not there, I go to work."
        - Robert Orben

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

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

* [2.6 patch] fs/configfs/ cleanups
  2008-02-27 22:36 ` Joel Becker
@ 2008-03-03 18:07   ` Adrian Bunk
  2008-03-03 20:17     ` Joel Becker
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2008-03-03 18:07 UTC (permalink / raw)
  To: Joel Becker, linux-kernel

On Wed, Feb 27, 2008 at 02:36:30PM -0800, Joel Becker wrote:
> On Wed, Feb 27, 2008 at 11:20:48PM +0200, Adrian Bunk wrote:
> > This patch contains the following cleanups:
> > - make the needlessly global file.c:configfs_add_file() static
> > - #if 0 the unused inode.c:configfs_hash_and_remove()
> > 
> > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> Acked-by: Joel Becker <joel.becker@oracle.com>
> 
> I'd also take a patch to remove configfs_hash_and_remove().

Patch below.

> Joel

cu
Adrian


<--  snip  -->


This patch contains the following cleanups:
- make the needlessly global file.c:configfs_add_file() static
- remove the unused inode.c:configfs_hash_and_remove()

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 fs/configfs/configfs_internal.h |    3 ---
 fs/configfs/file.c              |    3 ++-
 fs/configfs/inode.c             |   23 -----------------------
 3 files changed, 2 insertions(+), 27 deletions(-)

927a9da2f7bae91593a5735477c2605f34872302 foobar
diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
index cca9860..378fa36 100644
--- a/fs/configfs/configfs_internal.h
+++ b/fs/configfs/configfs_internal.h
@@ -63,9 +63,6 @@ extern int configfs_create_file(struct config_item *, const struct configfs_attr
 extern int configfs_make_dirent(struct configfs_dirent *,
 				struct dentry *, void *, umode_t, int);
 
-extern int configfs_add_file(struct dentry *, const struct configfs_attribute *, int);
-extern void configfs_hash_and_remove(struct dentry * dir, const char * name);
-
 extern const unsigned char * configfs_get_name(struct configfs_dirent *sd);
 extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent);
 extern int configfs_setattr(struct dentry *dentry, struct iattr *iattr);
diff --git a/fs/configfs/file.c b/fs/configfs/file.c
index 397cb50..f331a40 100644
--- a/fs/configfs/file.c
+++ b/fs/configfs/file.c
@@ -314,7 +314,8 @@ const struct file_operations configfs_file_operations = {
 };
 
 
-int configfs_add_file(struct dentry * dir, const struct configfs_attribute * attr, int type)
+static int configfs_add_file(struct dentry * dir,
+			     const struct configfs_attribute * attr, int type)
 {
 	struct configfs_dirent * parent_sd = dir->d_fsdata;
 	umode_t mode = (attr->ca_mode & S_IALLUGO) | S_IFREG;
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 4c1ebff..c655024 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -233,29 +233,6 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
 	}
 }
 
-void configfs_hash_and_remove(struct dentry * dir, const char * name)
-{
-	struct configfs_dirent * sd;
-	struct configfs_dirent * parent_sd = dir->d_fsdata;
-
-	if (dir->d_inode == NULL)
-		/* no inode means this hasn't been made visible yet */
-		return;
-
-	mutex_lock(&dir->d_inode->i_mutex);
-	list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
-		if (!sd->s_element)
-			continue;
-		if (!strcmp(configfs_get_name(sd), name)) {
-			list_del_init(&sd->s_sibling);
-			configfs_drop_dentry(sd, dir);
-			configfs_put(sd);
-			break;
-		}
-	}
-	mutex_unlock(&dir->d_inode->i_mutex);
-}
-
 int __init configfs_inode_init(void)
 {
 	return bdi_init(&configfs_backing_dev_info);


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

* Re: [2.6 patch] fs/configfs/ cleanups
  2008-03-03 18:07   ` [2.6 " Adrian Bunk
@ 2008-03-03 20:17     ` Joel Becker
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Becker @ 2008-03-03 20:17 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Mon, Mar 03, 2008 at 08:07:37PM +0200, Adrian Bunk wrote:
> > I'd also take a patch to remove configfs_hash_and_remove().
> 
> Patch below.
> 
> > Joel
> 
> cu
> Adrian
> 
> 
> <--  snip  -->
> 
> 
> This patch contains the following cleanups:
> - make the needlessly global file.c:configfs_add_file() static
> - remove the unused inode.c:configfs_hash_and_remove()
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Joel Becker <joel.becker@oracle.com>

> 
> ---
> 
>  fs/configfs/configfs_internal.h |    3 ---
>  fs/configfs/file.c              |    3 ++-
>  fs/configfs/inode.c             |   23 -----------------------
>  3 files changed, 2 insertions(+), 27 deletions(-)
> 
> 927a9da2f7bae91593a5735477c2605f34872302 foobar
> diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h
> index cca9860..378fa36 100644
> --- a/fs/configfs/configfs_internal.h
> +++ b/fs/configfs/configfs_internal.h
> @@ -63,9 +63,6 @@ extern int configfs_create_file(struct config_item *, const struct configfs_attr
>  extern int configfs_make_dirent(struct configfs_dirent *,
>  				struct dentry *, void *, umode_t, int);
>  
> -extern int configfs_add_file(struct dentry *, const struct configfs_attribute *, int);
> -extern void configfs_hash_and_remove(struct dentry * dir, const char * name);
> -
>  extern const unsigned char * configfs_get_name(struct configfs_dirent *sd);
>  extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent);
>  extern int configfs_setattr(struct dentry *dentry, struct iattr *iattr);
> diff --git a/fs/configfs/file.c b/fs/configfs/file.c
> index 397cb50..f331a40 100644
> --- a/fs/configfs/file.c
> +++ b/fs/configfs/file.c
> @@ -314,7 +314,8 @@ const struct file_operations configfs_file_operations = {
>  };
>  
>  
> -int configfs_add_file(struct dentry * dir, const struct configfs_attribute * attr, int type)
> +static int configfs_add_file(struct dentry * dir,
> +			     const struct configfs_attribute * attr, int type)
>  {
>  	struct configfs_dirent * parent_sd = dir->d_fsdata;
>  	umode_t mode = (attr->ca_mode & S_IALLUGO) | S_IFREG;
> diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
> index 4c1ebff..c655024 100644
> --- a/fs/configfs/inode.c
> +++ b/fs/configfs/inode.c
> @@ -233,29 +233,6 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
>  	}
>  }
>  
> -void configfs_hash_and_remove(struct dentry * dir, const char * name)
> -{
> -	struct configfs_dirent * sd;
> -	struct configfs_dirent * parent_sd = dir->d_fsdata;
> -
> -	if (dir->d_inode == NULL)
> -		/* no inode means this hasn't been made visible yet */
> -		return;
> -
> -	mutex_lock(&dir->d_inode->i_mutex);
> -	list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
> -		if (!sd->s_element)
> -			continue;
> -		if (!strcmp(configfs_get_name(sd), name)) {
> -			list_del_init(&sd->s_sibling);
> -			configfs_drop_dentry(sd, dir);
> -			configfs_put(sd);
> -			break;
> -		}
> -	}
> -	mutex_unlock(&dir->d_inode->i_mutex);
> -}
> -
>  int __init configfs_inode_init(void)
>  {
>  	return bdi_init(&configfs_backing_dev_info);
> 

-- 

"The first requisite of a good citizen in this republic of ours
 is that he shall be able and willing to pull his weight."
	- Theodore Roosevelt

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

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

end of thread, other threads:[~2008-03-03 20:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-27 21:20 [RFC: 2.6 patch] fs/configfs/ cleanups Adrian Bunk
2008-02-27 22:36 ` Joel Becker
2008-03-03 18:07   ` [2.6 " Adrian Bunk
2008-03-03 20:17     ` Joel Becker

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).