Re: [PATCH 1/2] blk-mq-debugfs: support rq_qos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2018-12-14 at 19:39 +-0800, Ming Lei wrote:
+AD4  static void print+AF8-stat(struct seq+AF8-file +ACo-m, struct blk+AF8-rq+AF8-stat +ACo-stat)
+AD4  +AHs
+AD4 +AEAAQA -856,6 +-857,15 +AEAAQA int blk+AF8-mq+AF8-debugfs+AF8-register(struct request+AF8-queue +ACo-q)
+AD4  			goto err+ADs
+AD4  	+AH0
+AD4  
+AD4 +-	if (q-+AD4-rq+AF8-qos) +AHs
+AD4 +-		struct rq+AF8-qos +ACo-rqos +AD0 q-+AD4-rq+AF8-qos+ADs
+AD4 +-
+AD4 +-		while (rqos) +AHs
+AD4 +-			blk+AF8-mq+AF8-debugfs+AF8-register+AF8-rqos(rqos)+ADs
+AD4 +-			rqos +AD0 rqos-+AD4-next+ADs
+AD4 +-		+AH0
+AD4 +-	+AH0

Have you considered to use a for-loop instead of a while loop? That would
allow to remove the if-statement and hence would make the code more compact.

+AD4 +-int blk+AF8-mq+AF8-debugfs+AF8-register+AF8-rqos(struct rq+AF8-qos +ACo-rqos)
+AD4 +-+AHs
+AD4 +-	struct request+AF8-queue +ACo-q +AD0 rqos-+AD4-q+ADs
+AD4 +-	char +ACo-dir+AF8-name +AD0 rq+AF8-qos+AF8-id+AF8-to+AF8-name(rqos-+AD4-id)+ADs

Please change +ACI-char +ACoAIg into +ACI-const char +ACoAIg.

+AD4  enum rq+AF8-qos+AF8-id +AHs
+AD4  	RQ+AF8-QOS+AF8-WBT,
+AD4  	RQ+AF8-QOS+AF8-CGROUP,
+AD4 +AEAAQA -22,6 +-26,9 +AEAAQA struct rq+AF8-qos +AHs
+AD4  	struct request+AF8-queue +ACo-q+ADs
+AD4  	enum rq+AF8-qos+AF8-id id+ADs
+AD4  	struct rq+AF8-qos +ACo-next+ADs
+AD4 +-+ACM-ifdef CONFIG+AF8-BLK+AF8-DEBUG+AF8-FS
+AD4 +-	struct dentry		+ACo-debugfs+AF8-dir+ADs
+AD4 +-+ACM-endif
+AD4  +AH0AOw

The indentation of +ACI-debugfs+AF8-dir+ACI looks odd to me.

+AD4 +-static inline char +ACo-rq+AF8-qos+AF8-id+AF8-to+AF8-name(enum rq+AF8-qos+AF8-id id)
+AD4 +-+AHs
+AD4 +-	switch (id) +AHs
+AD4 +-	case RQ+AF8-QOS+AF8-WBT:
+AD4 +-		return +ACI-wbt+ACIAOw
+AD4 +-	case RQ+AF8-QOS+AF8-CGROUP:
+AD4 +-		return +ACI-cgroup+ACIAOw
+AD4 +-	+AH0
+AD4 +-	return +ACI-unknown+ACIAOw
+AD4 +-+AH0

Same comment here as earlier: please use +ACI-const char +ACoAIg instead of +ACI-char +ACoAIg
for constant strings. Otherwise this patch looks fine to me.

Thanks,

Bart.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux