[PATCH] volume_id update (NTFS support)

David Zeuthen david at fubar.dk
Sun Jun 20 06:33:51 PDT 2004


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?

Cheers,
David



_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list