Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2011 16:09:24 -0700
From:      mdf@FreeBSD.org
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   Re: svn commit: r225154 - in projects/ino64/sys/ufs: ffs ufs
Message-ID:  <CAMBSHm8H8mzAvBSNmi4_wVYqxJNrxT3hGiJH9WL3u4Hr6UmdSg@mail.gmail.com>
In-Reply-To: <201108242214.p7OMEuMP072758@svn.freebsd.org>
References:  <201108242214.p7OMEuMP072758@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 24, 2011 at 3:14 PM, Matthew D Fleming <mdf@freebsd.org> wrote:
> Author: mdf
> Date: Wed Aug 24 22:14:55 2011
> New Revision: 225154
> URL: http://svn.freebsd.org/changeset/base/225154
>
> Log:
> =A0Use fixed-width types in on-disk structures. =A0This takes care of all=
 the
> =A0ino_t references I could find that were on-disk.
>
> =A0GSoC r223157.
> =A0Code by Gleb Kurtsou.

Note that I've explicitly left all the XXXfid structs alone; when
ino_t is changed to 64-bit they will use 64-bit members for inode
number.  The only in-tree one that may be a problem is ReiserFS which
will have a 32 byte FID after compiler padding is applied.  This can
be reduced to 24 bytes by reordering the members.  In theory, IIRC,
even 32 bits is an okay FID, however I have seen a note at $WORK that
NFSv2 has 32 byte file handles and BSD is using 8 bytes for the fsid.

If anyone knows anything more, please let me know.  For the moment I
think my plan is to re-order the members of various implementations to
keep them smaller, and leave it as an ino_t in the struct definition.

Thanks,
matthew

> Modified:
> =A0projects/ino64/sys/ufs/ffs/fs.h
> =A0projects/ino64/sys/ufs/ufs/dinode.h
>
> Modified: projects/ino64/sys/ufs/ffs/fs.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- projects/ino64/sys/ufs/ffs/fs.h =A0 =A0 Wed Aug 24 22:07:38 2011 =A0 =
=A0 =A0 =A0(r225153)
> +++ projects/ino64/sys/ufs/ffs/fs.h =A0 =A0 Wed Aug 24 22:14:55 2011 =A0 =
=A0 =A0 =A0(r225154)
> @@ -338,7 +338,7 @@ struct fs {
> =A0 =A0 =A0 =A0ufs2_daddr_t fs_csaddr; =A0 =A0 =A0 =A0 /* blk addr of cyl=
 grp summary area */
> =A0 =A0 =A0 =A0int64_t =A0fs_pendingblocks; =A0 =A0 =A0/* (u) blocks bein=
g freed */
> =A0 =A0 =A0 =A0u_int32_t fs_pendinginodes; =A0 =A0 /* (u) inodes being fr=
eed */
> - =A0 =A0 =A0 ino_t =A0 =A0fs_snapinum[FSMAXSNAP];/* list of snapshot ino=
de numbers */
> + =A0 =A0 =A0 u_int32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode =
numbers */
> =A0 =A0 =A0 =A0u_int32_t fs_avgfilesize; =A0 =A0 =A0 /* expected average =
file size */
> =A0 =A0 =A0 =A0u_int32_t fs_avgfpdir; =A0 =A0 =A0 =A0 =A0/* expected # of=
 files per directory */
> =A0 =A0 =A0 =A0int32_t =A0fs_save_cgsize; =A0 =A0 =A0 =A0/* save real cg =
size to use fs_bsize */
> @@ -695,8 +695,8 @@ struct jsegrec {
> =A0*/
> =A0struct jrefrec {
> =A0 =A0 =A0 =A0uint32_t =A0 =A0 =A0 =A0jr_op;
> - =A0 =A0 =A0 ino_t =A0 =A0 =A0 =A0 =A0 jr_ino;
> - =A0 =A0 =A0 ino_t =A0 =A0 =A0 =A0 =A0 jr_parent;
> + =A0 =A0 =A0 uint32_t =A0 =A0 =A0 =A0jr_ino;
> + =A0 =A0 =A0 uint32_t =A0 =A0 =A0 =A0jr_parent;
> =A0 =A0 =A0 =A0uint16_t =A0 =A0 =A0 =A0jr_nlink;
> =A0 =A0 =A0 =A0uint16_t =A0 =A0 =A0 =A0jr_mode;
> =A0 =A0 =A0 =A0off_t =A0 =A0 =A0 =A0 =A0 jr_diroff;
> @@ -709,8 +709,8 @@ struct jrefrec {
> =A0*/
> =A0struct jmvrec {
> =A0 =A0 =A0 =A0uint32_t =A0 =A0 =A0 =A0jm_op;
> - =A0 =A0 =A0 ino_t =A0 =A0 =A0 =A0 =A0 jm_ino;
> - =A0 =A0 =A0 ino_t =A0 =A0 =A0 =A0 =A0 jm_parent;
> + =A0 =A0 =A0 uint32_t =A0 =A0 =A0 =A0jm_ino;
> + =A0 =A0 =A0 uint32_t =A0 =A0 =A0 =A0jm_parent;
> =A0 =A0 =A0 =A0uint16_t =A0 =A0 =A0 =A0jm_unused;
> =A0 =A0 =A0 =A0off_t =A0 =A0 =A0 =A0 =A0 jm_oldoff;
> =A0 =A0 =A0 =A0off_t =A0 =A0 =A0 =A0 =A0 jm_newoff;
>
> Modified: projects/ino64/sys/ufs/ufs/dinode.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- projects/ino64/sys/ufs/ufs/dinode.h Wed Aug 24 22:07:38 2011 =A0 =A0 =
=A0 =A0(r225153)
> +++ projects/ino64/sys/ufs/ufs/dinode.h Wed Aug 24 22:14:55 2011 =A0 =A0 =
=A0 =A0(r225154)
> @@ -146,7 +146,7 @@ struct ufs2_dinode {
> =A0 =A0 =A0 =A0ufs2_daddr_t =A0 =A0di_db[NDADDR]; =A0/* 112: Direct disk =
blocks. */
> =A0 =A0 =A0 =A0ufs2_daddr_t =A0 =A0di_ib[NIADDR]; =A0/* 208: Indirect dis=
k blocks. */
> =A0 =A0 =A0 =A0u_int64_t =A0 =A0 =A0 di_modrev; =A0 =A0 =A0/* 232: i_modr=
ev for NFSv4 */
> - =A0 =A0 =A0 ino_t =A0 =A0 =A0 =A0 =A0 di_freelink; =A0 =A0/* 240: SUJ: =
Next unlinked inode. */
> + =A0 =A0 =A0 u_int32_t =A0 =A0 =A0 di_freelink; =A0 =A0/* 240: SUJ: Next=
 unlinked inode. */
> =A0 =A0 =A0 =A0uint32_t =A0 =A0 =A0 =A0di_spare[3]; =A0 =A0/* 244: Reserv=
ed; currently unused */
> =A0};
>
> @@ -168,7 +168,7 @@ struct ufs2_dinode {
> =A0struct ufs1_dinode {
> =A0 =A0 =A0 =A0u_int16_t =A0 =A0 =A0 di_mode; =A0 =A0 =A0 =A0/* =A0 0: IF=
MT, permissions; see below. */
> =A0 =A0 =A0 =A0int16_t =A0 =A0 =A0 =A0 di_nlink; =A0 =A0 =A0 /* =A0 2: Fi=
le link count. */
> - =A0 =A0 =A0 ino_t =A0 =A0 =A0 =A0 =A0 di_freelink; =A0 =A0/* =A0 4: SUJ=
: Next unlinked inode. */
> + =A0 =A0 =A0 u_int32_t =A0 =A0 =A0 di_freelink; =A0 =A0/* =A0 4: SUJ: Ne=
xt unlinked inode. */
> =A0 =A0 =A0 =A0u_int64_t =A0 =A0 =A0 di_size; =A0 =A0 =A0 =A0/* =A0 8: Fi=
le byte count. */
> =A0 =A0 =A0 =A0int32_t =A0 =A0 =A0 =A0 di_atime; =A0 =A0 =A0 /* =A016: La=
st access time. */
> =A0 =A0 =A0 =A0int32_t =A0 =A0 =A0 =A0 di_atimensec; =A0 /* =A020: Last a=
ccess time. */
>



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