Re: [PATCH 15/34] xfs: add a bests pointer to struct xfs_dir3_icfree_hdr

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

 



On Mon, Nov 04, 2019 at 12:21:45PM -0800, Darrick J. Wong wrote:
> > @@ -233,6 +233,7 @@ xfs_dir2_free_hdr_from_disk(
> >  		to->firstdb = be32_to_cpu(from3->hdr.firstdb);
> >  		to->nvalid = be32_to_cpu(from3->hdr.nvalid);
> >  		to->nused = be32_to_cpu(from3->hdr.nused);
> > +		to->bests = (void *)from3 + sizeof(struct xfs_dir3_free_hdr);
> 
> Urgh, isn't void pointer arithmetic technically illegal according to C?

It is not specified in ISO C, but clearly specified in the GNU C
extensions and used all over the kernel.

> In any case, shouldn't this cast through struct xfs_dir3_free instead of
> open-coding details of the disk format that we've already captured?  The
> same question also applies to the other patches that add pointers to
> ondisk leaf and intnode pointers into the incore header struct.

I don't really understand that sentence.  What would do you instead?



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux