Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Nov 2009 15:15:44 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Ed Schouten <ed@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r198706 - head/sys/sys
Message-ID:  <alpine.BSF.2.00.0911011506130.2930@fledge.watson.org>
In-Reply-To: <200910311035.n9VAZfIb082932@svn.freebsd.org>
References:  <200910311035.n9VAZfIb082932@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sat, 31 Oct 2009, Ed Schouten wrote:

>  Turn unused structure fields of cdevsw into spares.
>
>  d_uid, d_gid and d_mode are unused, because permissions are stored in
>  cdevpriv nowadays. d_kind doesn't seem to be used at all. We no longer
>  keep a list of cdevsw's, so d_list is also unused.
>
>  uid_t and gid_t are 32 bits, but mode_t is 16 bits, Because of alignment
>  constraints of d_kind, we can safely turn it into three 32-bit integers.
>  d_kind and d_list is equal in size to three pointers.

The underlying change seems fine, especially in -CURRENT, but I'm confused by 
the paragraph here on alignment and safety.  What do you mean by safe, and 
does it matter?  From a casual glance (perhaps mistaken), it looks like this 
changes the KBI, so all modules declaring struct cdevsw will need to be 
rebuilt.

Robert N M Watson
Computer Laboratory
University of Cambridge

>
>  Discussed with:	kib
>
> Modified:
>  head/sys/sys/conf.h
>
> Modified: head/sys/sys/conf.h
> ==============================================================================
> --- head/sys/sys/conf.h	Sat Oct 31 09:03:48 2009	(r198705)
> +++ head/sys/sys/conf.h	Sat Oct 31 10:35:41 2009	(r198706)
> @@ -210,15 +210,13 @@ struct cdevsw {
> 	d_kqfilter_t		*d_kqfilter;
> 	d_purge_t		*d_purge;
> 	d_mmap_single_t		*d_mmap_single;
> -	uid_t			d_uid;
> -	gid_t			d_gid;
> -	mode_t			d_mode;
> -	const char		*d_kind;
> +
> +	int32_t			d_spare0[3];
> +	void			*d_spare1[3];
>
> 	/* These fields should not be messed with by drivers */
> -	LIST_ENTRY(cdevsw)	d_list;
> 	LIST_HEAD(, cdev)	d_devs;
> -	int			d_spare3;
> +	int			d_spare2;
> 	union {
> 		struct cdevsw		*gianttrick;
> 		SLIST_ENTRY(cdevsw)	postfree_list;
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0911011506130.2930>