ext4: use kobj_completion in ext4_sb_info
PATCH 2/2 ext4: use kobj_completion in ext4_sb_info
Now that we have the kobj_completion structure available, let's use it in ext4.
Note that we aggregate the del/put/wait_for_completion in one kobj_completion_del_and_wait call. Since the kobject isn't used for anything while the fs is shutting down and we wait until it's released before continuing anyway, this is safe.
--- fs/ext4/ext4.h | 4 ++-- fs/ext4/super.c | 41 ++++++++++++----------------------------- 2 files changed, 14 insertions(+), 31 deletions(-)
fs/ext4/ext4.h +2 -2
@@ -30,6 +30,7 @@#include <linux/blockgroup_lock.h> #include <linux/percpu_counter.h> #include <crypto/hash.h> +#include <linux/kobj_completion.h> #ifdef __KERNEL__#include <linux/compat.h> #endif
@@ -1198,8 +1199,7 @@ struct ext4_sb_info {struct percpu_counter s_dirtyclusters_counter;struct blockgroup_lock *s_blockgroup_lock;struct proc_dir_entry *s_proc; -struct kobject s_kobj; -struct completion s_kobj_unregister; +struct kobj_completion s_kobjc;struct super_block *s_sb;/* Journaling */
fs/ext4/super.c +12 -29
96 lines not on this page · raw message
Signature · 2 lines
Jeff Mahoney SUSE Labs
Theodore Ts'o
maintainerQuoted 9 lines · Jeff Mahoney
Now that we have the
kobj_completionstructure available, let's use it in ext4.Note that we aggregate the del/put/wait_for_completion in one
kobj_completion_del_and_waitcall. Since the kobject isn't used for anything while the fs is shutting down and we wait until it's released before continuing anyway, this is safe.Signed-off-by Jeff Mahoney <[email protected]>
I don't have a huge objection to this, but given that it's not fixing a bug, and it's not saving _that_ many lines of code, if you want to run the first patch through Greg's tree (which is fine with me), I might wait to merge this patch until 3.13, so it's not obvious that it's worth dealing with the inter-tree dependency, since it complicates testing on my end.
Does that sound reasonable?
- Ted
Quoted 11 lines · Theodore Ts'o
Quoted 9 lines · Jeff Mahoney
Now that we have the
kobj_completionstructure available, let's use it in ext4.Note that we aggregate the del/put/wait_for_completion in one
kobj_completion_del_and_waitcall. Since the kobject isn't used for anything while the fs is shutting down and we wait until it's released before continuing anyway, this is safe.Signed-off-by Jeff Mahoney <[email protected]>
Quoted 8 lines
I don't have a huge objection to this, but given that it's not fixing a bug, and it's not saving _that_ many lines of code, if you want to run the first patch through Greg's tree (which is fine with me), I might wait to merge this patch until 3.13, so it's not obvious that it's worth dealing with the inter-tree dependency, since it complicates testing on my end.
Does that sound reasonable?
Works for me. The ext4 case isn't something I'm in a huge rush to get in -- it was just the most obvious (to me) existing users of the kobj/completion pair.
-Jeff
Signature · 2 lines
Jeff Mahoney SUSE Labs