All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] clean-up patch for autofs4
@ 2014-07-18  0:48 NeilBrown
  2014-07-18  0:48 ` [PATCH 2/5] autofs4: remove a redundant assignment NeilBrown
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: NeilBrown @ 2014-07-18  0:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: autofs, linux-kernel

Hi Andrew,
 I believe you shepherd autofs4 patches at present.
 The following 5 patches are some simple cleanups.
 4 are trivial.  One (the third) is a very simple optimization
 which will be more important after the next patch set, but
 is simple enough to be included now.

 The next patch set will make autofs4 RCU-walk friendly so that in the
 common case a filename lookup can walk across an autofs4 filesystem
 without taking spinlocks or refcounts.  I'll submit that once more
 testing and review have convinced Ian and myself that it is ready.

 Thanks,
 NeilBrown
 
---

NeilBrown (5):
      autofs4: remove unused autofs4_ispending()
      autofs4: remove a redundant assignment
      autofs4: don't take spinlock when not needed in autofs4_lookup_expiring
      autofs4: remove some unused inline functions.
      autofs4: comment typo: remove a a doubled word.


 fs/autofs4/autofs_i.h |   63 -------------------------------------------------
 fs/autofs4/expire.c   |    1 -
 fs/autofs4/root.c     |   10 +++++---
 3 files changed, 7 insertions(+), 67 deletions(-)

-- 
Signature


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

* [PATCH 1/5] autofs4: remove unused autofs4_ispending()
  2014-07-18  0:48 [PATCH 0/5] clean-up patch for autofs4 NeilBrown
                   ` (3 preceding siblings ...)
  2014-07-18  0:48 ` [PATCH 3/5] autofs4: don't take spinlock when not needed in autofs4_lookup_expiring NeilBrown
@ 2014-07-18  0:48 ` NeilBrown
  4 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2014-07-18  0:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: autofs, linux-kernel, Ian Kent

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Ian Kent <raven@themaw.net>
---
 fs/autofs4/autofs_i.h |   14 --------------
 1 file changed, 14 deletions(-)

diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index acf32054edd8..22a280151e45 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -143,20 +143,6 @@ static inline int autofs4_oz_mode(struct autofs_sb_info *sbi) {
 	return sbi->catatonic || task_pgrp(current) == sbi->oz_pgrp;
 }
 
-/* Does a dentry have some pending activity? */
-static inline int autofs4_ispending(struct dentry *dentry)
-{
-	struct autofs_info *inf = autofs4_dentry_ino(dentry);
-
-	if (inf->flags & AUTOFS_INF_PENDING)
-		return 1;
-
-	if (inf->flags & AUTOFS_INF_EXPIRING)
-		return 1;
-
-	return 0;
-}
-
 struct inode *autofs4_get_inode(struct super_block *, umode_t);
 void autofs4_free_ino(struct autofs_info *);
 



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

* [PATCH 2/5] autofs4: remove a redundant assignment
  2014-07-18  0:48 [PATCH 0/5] clean-up patch for autofs4 NeilBrown
@ 2014-07-18  0:48 ` NeilBrown
  2014-07-18  0:48 ` [PATCH 4/5] autofs4: remove some unused inline functions NeilBrown
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2014-07-18  0:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: autofs, linux-kernel, Ian Kent

The variable 'ino' already exists and already
has the correct value.  The d_fsdata of a dentry
is never changed after the d_fsdata is instantiated,
so this new assignment cannot be necessary.

It was introduced in
commit b5b801779d59165c4ecf1009009109545bd1f642
    autofs4: Add d_manage() dentry operation

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Ian Kent <raven@themaw.net>
---
 fs/autofs4/expire.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 394e90b02c5e..a7be57e39be7 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -333,7 +333,6 @@ struct dentry *autofs4_expire_direct(struct super_block *sb,
 	if (ino->flags & AUTOFS_INF_PENDING)
 		goto out;
 	if (!autofs4_direct_busy(mnt, root, timeout, do_now)) {
-		struct autofs_info *ino = autofs4_dentry_ino(root);
 		ino->flags |= AUTOFS_INF_EXPIRING;
 		init_completion(&ino->expire_complete);
 		spin_unlock(&sbi->fs_lock);



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

* [PATCH 3/5] autofs4: don't take spinlock when not needed in autofs4_lookup_expiring
  2014-07-18  0:48 [PATCH 0/5] clean-up patch for autofs4 NeilBrown
                   ` (2 preceding siblings ...)
  2014-07-18  0:48 ` [PATCH 5/5] autofs4: comment typo: remove a a doubled word NeilBrown
@ 2014-07-18  0:48 ` NeilBrown
  2014-07-18  0:48 ` [PATCH 1/5] autofs4: remove unused autofs4_ispending() NeilBrown
  4 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2014-07-18  0:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: autofs, linux-kernel, Ian Kent

If the expiring_list is empty, we can avoid a costly spinlock
in the rcu-walk path through autofs4_d_manage (once the rest
of the path becomes rcu-walk friendly).

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Ian Kent <raven@themaw.net>
---
 fs/autofs4/root.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index cc87c1abac97..fb202cadd4b3 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -166,8 +166,10 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry)
 	const unsigned char *str = name->name;
 	struct list_head *p, *head;
 
-	spin_lock(&sbi->lookup_lock);
 	head = &sbi->active_list;
+	if (list_empty(head))
+		return NULL;
+	spin_lock(&sbi->lookup_lock);
 	list_for_each(p, head) {
 		struct autofs_info *ino;
 		struct dentry *active;
@@ -218,8 +220,10 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry)
 	const unsigned char *str = name->name;
 	struct list_head *p, *head;
 
-	spin_lock(&sbi->lookup_lock);
 	head = &sbi->expiring_list;
+	if (list_empty(head))
+		return NULL;
+	spin_lock(&sbi->lookup_lock);
 	list_for_each(p, head) {
 		struct autofs_info *ino;
 		struct dentry *expiring;



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

* [PATCH 4/5] autofs4: remove some unused inline functions.
  2014-07-18  0:48 [PATCH 0/5] clean-up patch for autofs4 NeilBrown
  2014-07-18  0:48 ` [PATCH 2/5] autofs4: remove a redundant assignment NeilBrown
@ 2014-07-18  0:48 ` NeilBrown
  2014-07-18  0:48 ` [PATCH 5/5] autofs4: comment typo: remove a a doubled word NeilBrown
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2014-07-18  0:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: autofs, linux-kernel, Ian Kent

{__,}manage_dentry_{set,clear}_{automount,transit}

are 4 unused inline functions.  Discard them.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Ian Kent <raven@themaw.net>
---
 fs/autofs4/autofs_i.h |   49 -------------------------------------------------
 1 file changed, 49 deletions(-)

diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 22a280151e45..9e359fb20c0a 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -177,55 +177,6 @@ extern const struct file_operations autofs4_root_operations;
 extern const struct dentry_operations autofs4_dentry_operations;
 
 /* VFS automount flags management functions */
-
-static inline void __managed_dentry_set_automount(struct dentry *dentry)
-{
-	dentry->d_flags |= DCACHE_NEED_AUTOMOUNT;
-}
-
-static inline void managed_dentry_set_automount(struct dentry *dentry)
-{
-	spin_lock(&dentry->d_lock);
-	__managed_dentry_set_automount(dentry);
-	spin_unlock(&dentry->d_lock);
-}
-
-static inline void __managed_dentry_clear_automount(struct dentry *dentry)
-{
-	dentry->d_flags &= ~DCACHE_NEED_AUTOMOUNT;
-}
-
-static inline void managed_dentry_clear_automount(struct dentry *dentry)
-{
-	spin_lock(&dentry->d_lock);
-	__managed_dentry_clear_automount(dentry);
-	spin_unlock(&dentry->d_lock);
-}
-
-static inline void __managed_dentry_set_transit(struct dentry *dentry)
-{
-	dentry->d_flags |= DCACHE_MANAGE_TRANSIT;
-}
-
-static inline void managed_dentry_set_transit(struct dentry *dentry)
-{
-	spin_lock(&dentry->d_lock);
-	__managed_dentry_set_transit(dentry);
-	spin_unlock(&dentry->d_lock);
-}
-
-static inline void __managed_dentry_clear_transit(struct dentry *dentry)
-{
-	dentry->d_flags &= ~DCACHE_MANAGE_TRANSIT;
-}
-
-static inline void managed_dentry_clear_transit(struct dentry *dentry)
-{
-	spin_lock(&dentry->d_lock);
-	__managed_dentry_clear_transit(dentry);
-	spin_unlock(&dentry->d_lock);
-}
-
 static inline void __managed_dentry_set_managed(struct dentry *dentry)
 {
 	dentry->d_flags |= (DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT);



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

* [PATCH 5/5] autofs4: comment typo: remove a a doubled word.
  2014-07-18  0:48 [PATCH 0/5] clean-up patch for autofs4 NeilBrown
  2014-07-18  0:48 ` [PATCH 2/5] autofs4: remove a redundant assignment NeilBrown
  2014-07-18  0:48 ` [PATCH 4/5] autofs4: remove some unused inline functions NeilBrown
@ 2014-07-18  0:48 ` NeilBrown
  2014-07-18  0:48 ` [PATCH 3/5] autofs4: don't take spinlock when not needed in autofs4_lookup_expiring NeilBrown
  2014-07-18  0:48 ` [PATCH 1/5] autofs4: remove unused autofs4_ispending() NeilBrown
  4 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2014-07-18  0:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: autofs, linux-kernel, Ian Kent

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Ian Kent <raven@themaw.net>
---
 fs/autofs4/root.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index fb202cadd4b3..cdb25ebccc4c 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -377,7 +377,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
 		 * this because the leaves of the directory tree under the
 		 * mount never trigger mounts themselves (they have an autofs
 		 * trigger mount mounted on them). But v4 pseudo direct mounts
-		 * do need the leaves to to trigger mounts. In this case we
+		 * do need the leaves to trigger mounts. In this case we
 		 * have no choice but to use the list_empty() check and
 		 * require user space behave.
 		 */



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

end of thread, other threads:[~2014-07-18  0:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-18  0:48 [PATCH 0/5] clean-up patch for autofs4 NeilBrown
2014-07-18  0:48 ` [PATCH 2/5] autofs4: remove a redundant assignment NeilBrown
2014-07-18  0:48 ` [PATCH 4/5] autofs4: remove some unused inline functions NeilBrown
2014-07-18  0:48 ` [PATCH 5/5] autofs4: comment typo: remove a a doubled word NeilBrown
2014-07-18  0:48 ` [PATCH 3/5] autofs4: don't take spinlock when not needed in autofs4_lookup_expiring NeilBrown
2014-07-18  0:48 ` [PATCH 1/5] autofs4: remove unused autofs4_ispending() NeilBrown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.