Re: [PATCH v2 2/2] ceph: add IO size metrics support

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

 



On 2021/4/28 2:41, Jeff Layton wrote:
On Thu, 2021-03-25 at 11:28 +0800, xiubli@xxxxxxxxxx wrote:
...
+static inline void __update_size(struct ceph_client_metric *m,
+				 metric_type type, unsigned int size)
+{
+	switch (type) {
+	case CEPH_METRIC_READ:
+		++m->total_reads;
+		m->read_size_sum += size;
+		METRIC_UPDATE_MIN_MAX(m->read_size_min,
+				      m->read_size_max,
+				      size);
+		return;
+	case CEPH_METRIC_WRITE:
+		++m->total_writes;
+		m->write_size_sum += size;
+		METRIC_UPDATE_MIN_MAX(m->write_size_min,
+				      m->write_size_max,
+				      size);
+		return;
+	case CEPH_METRIC_METADATA:
+	default:
+		return;
+	}
+}
+
Ditto here re: patch 1. This switch adds nothing and just adds in some
extra branching. I'd just open code these into their (only) callers.

Sure.






[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux