Date: Sat, 8 Mar 2003 19:03:19 -0800 (PST) From: Nate Lawson <nate@root.org> To: Poul-Henning Kamp <phk@FreeBSD.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org Subject: Re: cvs commit: src/sys/sys devicestat.h Message-ID: <Pine.BSF.4.21.0303081754050.90870-100000@root.org> In-Reply-To: <20030308195605.D5D2837B4BC@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 8 Mar 2003, Poul-Henning Kamp wrote:
> Modified files:
> sys/sys devicestat.h
> Log:
> Augment the devstat structure with 3 new fields and bump the DEVSTAT_VERSION.
>
> Two fields are sequence numbers for integrity check when we switch devstat
> to use mmap to export data rather than sysctl, the last field is to mark
> this as an allocated devstat entry.
>
> Revision Changes Path
> 1.19 +14 -1 src/sys/sys/devicestat.h
It would be nice to see some email on arch@ about this. There may have
been others working on functionality in this area.
> @@ -121,6 +124,8 @@
> } devstat_type_flags;
>
> struct devstat {
> + int sequence0; /* Update sequence# */
> + int allocated; /* Allocated entry */
> STAILQ_ENTRY(devstat) dev_links;
> u_int32_t device_number; /*
> * Devstat device
> @@ -203,12 +208,20 @@
> */
> devstat_type_flags device_type; /* Device type */
> devstat_priority priority; /* Controls list pos. */
> +
> + int sequence1; /* Update sequence# */
> };
Is there a reason for adding one element at the beginning and one at the
end? Despite the fact this API is properly versioned, I believe accepted
practice is to add items at the end unless other requirements supersede
this one.
>+struct devstat *devstat_new_entry(const char *dev_name,
>+ int unit_number, u_int32_t block_size,
>+ devstat_support_flags flags,
>+ devstat_type_flags device_type,
>+ devstat_priority priority);
This only differs from devstat_add_entry by the fact that it returns a new
devstat rather than leaving that to the user. Is there any reason not to
make this two separate calls: devstat_alloc and then devstat_add_entry?
Again, posting a diff might have revealed that others are sitting on some
API changes that could have been rolled into this one.
-Nate
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-src" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0303081754050.90870-100000>
