Re: [PATCH v2 3/8] block: Replace all ktype default_attrs with groups

From: Bart Van Assche
Date: Tue Apr 02 2019 - 14:06:48 EST


On Tue, 2019-04-02 at 19:46 +-0200, Greg Kroah-Hartman wrote:
+AD4 On Tue, Apr 02, 2019 at 09:02:38AM -0700, Bart Van Assche wrote:
+AD4 +AD4 On Mon, 2019-04-01 at 22:51 -0400, Kimberly Brown wrote:
+AD4 +AD4 +AD4 The kobj+AF8-type default+AF8-attrs field is being replaced by the
+AD4 +AD4 +AD4 default+AF8-groups field. Replace all of the ktype default+AF8-attrs fields in
+AD4 +AD4 +AD4 the block subsystem with default+AF8-groups and use the ATTRIBUTE+AF8-GROUPS
+AD4 +AD4 +AD4 macro to create the default groups.
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 Remove default+AF8-ctx+AF8-attrs+AFsAXQ because it doesn't contain any attributes.
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 This patch was tested by verifying that the sysfs files for the
+AD4 +AD4 +AD4 attributes in the default groups were created.
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 Signed-off-by: Kimberly Brown +ADw-kimbrownkd+AEA-gmail.com+AD4
+AD4 +AD4 +AD4 ---
+AD4 +AD4 +AD4 block/blk-integrity.c +AHw 3 +-+--
+AD4 +AD4 +AD4 block/blk-mq-sysfs.c +AHw 8 +-+-------
+AD4 +AD4 +AD4 block/blk-sysfs.c +AHw 3 +-+--
+AD4 +AD4 +AD4 3 files changed, 6 insertions(+-), 8 deletions(-)
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 diff --git a/block/blk-integrity.c b/block/blk-integrity.c
+AD4 +AD4 +AD4 index d1ab089e0919..85864c71e858 100644
+AD4 +AD4 +AD4 --- a/block/blk-integrity.c
+AD4 +AD4 +AD4 +-+-+- b/block/blk-integrity.c
+AD4 +AD4 +AD4 +AEAAQA -365,6 +-365,7 +AEAAQA static struct attribute +ACo-integrity+AF8-attrs+AFsAXQ +AD0 +AHs
+AD4 +AD4 +AD4 +ACY-integrity+AF8-device+AF8-entry.attr,
+AD4 +AD4 +AD4 NULL,
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4 +AD4 +-ATTRIBUTE+AF8-GROUPS(integrity)+ADs
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 static const struct sysfs+AF8-ops integrity+AF8-ops +AD0 +AHs
+AD4 +AD4 +AD4 .show +AD0 +ACY-integrity+AF8-attr+AF8-show,
+AD4 +AD4 +AD4 +AEAAQA -372,7 +-373,7 +AEAAQA static const struct sysfs+AF8-ops integrity+AF8-ops +AD0 +AHs
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 static struct kobj+AF8-type integrity+AF8-ktype +AD0 +AHs
+AD4 +AD4 +AD4 - .default+AF8-attrs +AD0 integrity+AF8-attrs,
+AD4 +AD4 +AD4 +- .default+AF8-groups +AD0 integrity+AF8-groups,
+AD4 +AD4 +AD4 .sysfs+AF8-ops +AD0 +ACY-integrity+AF8-ops,
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c
+AD4 +AD4 +AD4 index 3f9c3f4ac44c..5315e538b3b1 100644
+AD4 +AD4 +AD4 --- a/block/blk-mq-sysfs.c
+AD4 +AD4 +AD4 +-+-+- b/block/blk-mq-sysfs.c
+AD4 +AD4 +AD4 +AEAAQA -173,10 +-173,6 +AEAAQA static ssize+AF8-t blk+AF8-mq+AF8-hw+AF8-sysfs+AF8-cpus+AF8-show(struct blk+AF8-mq+AF8-hw+AF8-ctx +ACo-hctx, char +ACo-page)
+AD4 +AD4 +AD4 return ret+ADs
+AD4 +AD4 +AD4 +AH0
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 -static struct attribute +ACo-default+AF8-ctx+AF8-attrs+AFsAXQ +AD0 +AHs
+AD4 +AD4 +AD4 - NULL,
+AD4 +AD4 +AD4 -+AH0AOw
+AD4 +AD4 +AD4 -
+AD4 +AD4 +AD4 static struct blk+AF8-mq+AF8-hw+AF8-ctx+AF8-sysfs+AF8-entry blk+AF8-mq+AF8-hw+AF8-sysfs+AF8-nr+AF8-tags +AD0 +AHs
+AD4 +AD4 +AD4 .attr +AD0 +AHs.name +AD0 +ACI-nr+AF8-tags+ACI, .mode +AD0 0444 +AH0,
+AD4 +AD4 +AD4 .show +AD0 blk+AF8-mq+AF8-hw+AF8-sysfs+AF8-nr+AF8-tags+AF8-show,
+AD4 +AD4 +AD4 +AEAAQA -196,6 +-192,7 +AEAAQA static struct attribute +ACo-default+AF8-hw+AF8-ctx+AF8-attrs+AFsAXQ +AD0 +AHs
+AD4 +AD4 +AD4 +ACY-blk+AF8-mq+AF8-hw+AF8-sysfs+AF8-cpus.attr,
+AD4 +AD4 +AD4 NULL,
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4 +AD4 +-ATTRIBUTE+AF8-GROUPS(default+AF8-hw+AF8-ctx)+ADs
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 static const struct sysfs+AF8-ops blk+AF8-mq+AF8-sysfs+AF8-ops +AD0 +AHs
+AD4 +AD4 +AD4 .show +AD0 blk+AF8-mq+AF8-sysfs+AF8-show,
+AD4 +AD4 +AD4 +AEAAQA -214,13 +-211,12 +AEAAQA static struct kobj+AF8-type blk+AF8-mq+AF8-ktype +AD0 +AHs
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 static struct kobj+AF8-type blk+AF8-mq+AF8-ctx+AF8-ktype +AD0 +AHs
+AD4 +AD4 +AD4 .sysfs+AF8-ops +AD0 +ACY-blk+AF8-mq+AF8-sysfs+AF8-ops,
+AD4 +AD4 +AD4 - .default+AF8-attrs +AD0 default+AF8-ctx+AF8-attrs,
+AD4 +AD4 +AD4 .release +AD0 blk+AF8-mq+AF8-ctx+AF8-sysfs+AF8-release,
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 static struct kobj+AF8-type blk+AF8-mq+AF8-hw+AF8-ktype +AD0 +AHs
+AD4 +AD4 +AD4 .sysfs+AF8-ops +AD0 +ACY-blk+AF8-mq+AF8-hw+AF8-sysfs+AF8-ops,
+AD4 +AD4 +AD4 - .default+AF8-attrs +AD0 default+AF8-hw+AF8-ctx+AF8-attrs,
+AD4 +AD4 +AD4 +- .default+AF8-groups +AD0 default+AF8-hw+AF8-ctx+AF8-groups,
+AD4 +AD4 +AD4 .release +AD0 blk+AF8-mq+AF8-hw+AF8-sysfs+AF8-release,
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
+AD4 +AD4 +AD4 index 422327089e0f..7a95a1eb27e1 100644
+AD4 +AD4 +AD4 --- a/block/blk-sysfs.c
+AD4 +AD4 +AD4 +-+-+- b/block/blk-sysfs.c
+AD4 +AD4 +AD4 +AEAAQA -769,6 +-769,7 +AEAAQA static struct attribute +ACo-default+AF8-attrs+AFsAXQ +AD0 +AHs
+AD4 +AD4 +AD4 +ACM-endif
+AD4 +AD4 +AD4 NULL,
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4 +AD4 +-ATTRIBUTE+AF8-GROUPS(default)+ADs
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 +ACM-define to+AF8-queue(atr) container+AF8-of((atr), struct queue+AF8-sysfs+AF8-entry, attr)
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 +AEAAQA -890,7 +-891,7 +AEAAQA static const struct sysfs+AF8-ops queue+AF8-sysfs+AF8-ops +AD0 +AHs
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 struct kobj+AF8-type blk+AF8-queue+AF8-ktype +AD0 +AHs
+AD4 +AD4 +AD4 .sysfs+AF8-ops +AD0 +ACY-queue+AF8-sysfs+AF8-ops,
+AD4 +AD4 +AD4 - .default+AF8-attrs +AD0 default+AF8-attrs,
+AD4 +AD4 +AD4 +- .default+AF8-groups +AD0 default+AF8-groups,
+AD4 +AD4 +AD4 .release +AD0 blk+AF8-release+AF8-queue,
+AD4 +AD4 +AD4 +AH0AOw
+AD4 +AD4
+AD4 +AD4 I think this should have been four patches instead of one.
+AD4
+AD4 4? I could maybe see 3, how would you make 4 patches out of this?

Hi Greg,

Not that it matters, but I see four changes in this patch: three conversions
from default+AF8-attrs into default+AF8-groups and also the removal of default+AF8-ctx+AF8-attrs.

Thanks,

Bart.