Why not the even dumber one? Forget FMT_SECTOR_T and always use %Lu and
typecast (unsigned long long)sector_t_variable in the printk.
May be ugly, but isn't it correct that you actually need the above typecast
on some architectures where %Lu == unsigned long long != u64?
Anton
>--- 2.5.14/include/linux/types.h~sector_t-printing Thu May 9
>17:08:13 2002
>+++ 2.5.14-akpm/include/linux/types.h Thu May 9 17:08:13 2002
>@@ -120,8 +120,10 @@ typedef __s64 int64_t;
>
> #ifdef BLK_64BIT_SECTOR
> typedef u64 sector_t;
>+#define FMT_SECTOR_T "%Lu"
> #else
> typedef unsigned long sector_t;
>+#define FMT_SECTOR_T "%lu"
> #endif
>
> #endif /* __KERNEL_STRICT_NAMES */
>--- 2.5.14/fs/buffer.c~sector_t-printing Thu May 9 17:08:13 2002
>+++ 2.5.14-akpm/fs/buffer.c Thu May 9 17:09:35 2002
>@@ -179,7 +179,8 @@ __clear_page_buffers(struct page *page)
>
> static void buffer_io_error(struct buffer_head *bh)
> {
>- printk(KERN_ERR "Buffer I/O error on device %s, logical block %ld\n",
>+ printk(KERN_ERR "Buffer I/O error on device %s,"
>+ " logical block " FMT_SECTOR_T "\n",
> bdevname(bh->b_bdev), bh->b_blocknr);
> }
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
-- "I've not lost my mind. It's backed up on tape somewhere." - Unknown-- Anton Altaparmakov <aia21 at cantab.net> (replace at with @) Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/