]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: nfs fh encoding cleanup
authorSage Weil <sage@newdream.net>
Mon, 12 May 2008 17:31:29 +0000 (10:31 -0700)
committerSage Weil <sage@newdream.net>
Mon, 12 May 2008 17:31:29 +0000 (10:31 -0700)
src/kernel/export.c
src/vstart.sh

index eb45147fb1b18a2347e1aed77ce3e01171c44947..bb0f5cc0bac35a9d0f95ec92383d104084c8b6b1 100644 (file)
@@ -12,17 +12,19 @@ int ceph_debug_export = -1;
  *  <ino, parent's d_name.hash>
  */
 
+#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 = {
index 0abc0595d10ae4c8a05e9809968a16cf6772437a..d68b8b81e66da77acd8301aa9b2844342406467c 100755 (executable)
@@ -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."