Re: [PATCH 17/21] ceph: nfs re-export support

From: Stefan Richter
Date: Sat Jun 20 2009 - 05:12:54 EST


Sage Weil wrote:
+++ b/fs/staging/ceph/export.c
...
+static struct dentry *ceph_fh_to_parent(struct super_block *sb, struct fid *fid,
+ int fh_len, int fh_type)
+{
+ u32 *fh = fid->raw;
+ u64 ino = *(u64 *)fh;
+ u32 hash = fh[2];
+
+ derr(10, "fh_to_parent %llx.%x\n", ino, hash);
+
+ if (fh_len < 6)
+ return ERR_PTR(-ESTALE);
+
+ return __fh_to_dentry(sb, (struct ceph_export_item *)fh + 1,
+ fh_len/IPSZ - 1);
+}

fid->raw could be 32-bit aligned, couldn't it?

#include <asm/unaligned.h>

u64 ino = get_unaligned((u64 *)fh);

derr(10, "fh_to_parent %llx.%x\n",
(unsigned long long)ino, hash);

(not tested)

I remember somebody saying that u64 should become unsigned long long on all architectures eventually; is there still such a plan?
--
Stefan Richter
-=====-==--= -==- =-=--
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/