diff --git a/src/kernel/export.c b/src/kernel/export.c index eb45147fb1b..bb0f5cc0bac 100644 --- a/src/kernel/export.c +++ b/src/kernel/export.c @@ -12,17 +12,19 @@ int ceph_debug_export = -1; * */ +#define IPSZ (sizeof(struct ceph_inopath_item) / sizeof(u32)) + int ceph_encode_fh(struct dentry *dentry, __u32 *rawfh, int *max_len, int connectable) { int type = 1; struct ceph_inopath_item *fh = (struct ceph_inopath_item *)rawfh; - int max = *max_len / 3; + int max = *max_len / IPSZ; int len; - dout(10, "encode_fh %p max_len %d (%d)%s\n", dentry, *max_len, max, - connectable ? " connectable":""); + dout(10, "encode_fh %p max_len %d u32s (%d inopath items)%s\n", dentry, + *max_len, max, connectable ? " connectable":""); if (max < 1 || (connectable && max < 2)) return -ENOSPC; @@ -46,7 +48,7 @@ int ceph_encode_fh(struct dentry *dentry, __u32 *rawfh, int *max_len, break; } - *max_len = len * 3; + *max_len = len * IPSZ; return type; } @@ -96,7 +98,7 @@ struct dentry *ceph_fh_to_dentry(struct super_block *sb, struct fid *fid, int fh_len, int fh_type) { u32 *fh = fid->raw; - return __fh_to_dentry(sb, (struct ceph_inopath_item *)fh, fh_len/3); + return __fh_to_dentry(sb, (struct ceph_inopath_item *)fh, fh_len/IPSZ); } struct dentry *ceph_fh_to_parent(struct super_block *sb, struct fid *fid, @@ -112,7 +114,7 @@ struct dentry *ceph_fh_to_parent(struct super_block *sb, struct fid *fid, return ERR_PTR(-ESTALE); return __fh_to_dentry(sb, (struct ceph_inopath_item *)fh + 1, - fh_len/3 - 1); + fh_len/IPSZ - 1); } const struct export_operations ceph_export_ops = { diff --git a/src/vstart.sh b/src/vstart.sh index 0abc0595d10..d68b8b81e66 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -43,7 +43,7 @@ do done # mds -$CEPH_BIN/cmds $ARGS --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 1 #--debug_ms 20 +$CEPH_BIN/cmds $ARGS --debug_ms 1 --debug_mds 20 --mds_thrash_fragments 0 #--debug_ms 20 echo "started. stop.sh to stop. see out/* (e.g. 'tail -f out/????') for debug output."