lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 26 Feb 2016 13:38:35 +0100
From:	Christoph Hellwig <hch@....de>
To:	jlbec@...lplan.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] configfs: remove the unused disconnect_notify callback

This callback was introduced a long time ago, but never actually used.

Remove the dead code.

Signed-off-by: Christoph Hellwig <hch@....de>
---
 Documentation/filesystems/configfs/configfs.txt | 10 +---------
 fs/configfs/dir.c                               | 25 -------------------------
 include/linux/configfs.h                        |  1 -
 3 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/Documentation/filesystems/configfs/configfs.txt b/Documentation/filesystems/configfs/configfs.txt
index 8ec9136..7e25ea3 100644
--- a/Documentation/filesystems/configfs/configfs.txt
+++ b/Documentation/filesystems/configfs/configfs.txt
@@ -272,8 +272,6 @@ config_item_type.
 		struct config_group *(*make_group)(struct config_group *group,
 						   const char *name);
 		int (*commit_item)(struct config_item *item);
-		void (*disconnect_notify)(struct config_group *group,
-					  struct config_item *item);
 		void (*drop_item)(struct config_group *group,
 				  struct config_item *item);
 	};
@@ -306,13 +304,7 @@ is gone from configfs.
 
 When drop_item() is called, the item's linkage has already been torn
 down.  It no longer has a reference on its parent and has no place in
-the item hierarchy.  If a client needs to do some cleanup before this
-teardown happens, the subsystem can implement the
-ct_group_ops->disconnect_notify() method.  The method is called after
-configfs has removed the item from the filesystem view but before the
-item is removed from its parent group.  Like drop_item(),
-disconnect_notify() is void and cannot fail.  Client subsystems should
-not drop any references here, as they still must do it in drop_item().
+the item hierarchy.
 
 A config_group cannot be removed while it still has child items.  This
 is implemented in the configfs rmdir(2) code.  ->drop_item() will not be
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index b51ce67..6f31462c 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -895,28 +895,6 @@ static void configfs_detach_group(struct config_item *item)
 }
 
 /*
- * After the item has been detached from the filesystem view, we are
- * ready to tear it out of the hierarchy.  Notify the client before
- * we do that so they can perform any cleanup that requires
- * navigating the hierarchy.  A client does not need to provide this
- * callback.  The subsystem semaphore MUST be held by the caller, and
- * references must be valid for both items.  It also assumes the
- * caller has validated ci_type.
- */
-static void client_disconnect_notify(struct config_item *parent_item,
-				     struct config_item *item)
-{
-	struct config_item_type *type;
-
-	type = parent_item->ci_type;
-	BUG_ON(!type);
-
-	if (type->ct_group_ops && type->ct_group_ops->disconnect_notify)
-		type->ct_group_ops->disconnect_notify(to_config_group(parent_item),
-						      item);
-}
-
-/*
  * Drop the initial reference from make_item()/make_group()
  * This function assumes that reference is held on item
  * and that item holds a valid reference to the parent.  Also, it
@@ -1402,7 +1380,6 @@ out_unlink:
 		/* Tear down everything we built up */
 		mutex_lock(&subsys->su_mutex);
 
-		client_disconnect_notify(parent_item, item);
 		if (group)
 			unlink_group(group);
 		else
@@ -1506,13 +1483,11 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry)
 		configfs_detach_group(item);
 
 		mutex_lock(&subsys->su_mutex);
-		client_disconnect_notify(parent_item, item);
 		unlink_group(to_config_group(item));
 	} else {
 		configfs_detach_item(item);
 
 		mutex_lock(&subsys->su_mutex);
-		client_disconnect_notify(parent_item, item);
 		unlink_obj(item);
 	}
 
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 485fe55..7dd0e8a 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -235,7 +235,6 @@ struct configfs_group_operations {
 	struct config_item *(*make_item)(struct config_group *group, const char *name);
 	struct config_group *(*make_group)(struct config_group *group, const char *name);
 	int (*commit_item)(struct config_item *item);
-	void (*disconnect_notify)(struct config_group *group, struct config_item *item);
 	void (*drop_item)(struct config_group *group, struct config_item *item);
 };
 
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ