[PATCH] volume_id update (NTFS support)
kay.sievers at vrfy.org
Sun Jun 20 06:46:59 PDT 2004
On Sun, 2004-06-20 at 15:33 +0200, David Zeuthen wrote:
> On Sat, 2004-06-19 at 23:50 +0200, Kay Sievers wrote:
> > Hi,
> > here is a update to the volume label/uuid sniffer. It now supports
> > reading of NTFS labels, without the need of mounting the volume.
> > The patch is damn big, cause I've run into trouble with the comparisone
> > of signed and unsigned chars while operating on the buffers. So I've
> > made it all unsigned. gcc-3.4 seems to align the fields in the structures,
> > so __packed__ was also needed.
> Nice, it looks good overall, very nice functionality, but this looks a
> bit fishy
> > +#define bswap64(x) (__u64)((((__u64)(x) & 0xff00000000000000u) >> 56) | \
> > + (((__u64)(x) & 0x00ff000000000000u) >> 40) | \
> > + (((__u64)(x) & 0x0000ff0000000000u) >> 24) | \
> > + (((__u64)(x) & 0x000000ff00000000u) >> 8) | \
> > + (((__u64)(x) & 0x00000000ff000000u) >> 8) | \
> > + (((__u64)(x) & 0x0000000000ff0000u) >> 24) | \
> > + (((__u64)(x) & 0x000000000000ff00u) >> 40) | \
> > + (((__u64)(x) & 0x00000000000000ffu) >> 56))
> > +
> Shouldn't the last four lines be using << instead of >> or have I lost
> my marbles?
Oh bad, sorry. The copy/paste devil hit me another time. Seems, that I
need a big endian box sometimes :)
Should I post a corrected patch?
hal mailing list
hal at freedesktop.org
More information about the Hal