From 1414831555b266b8e32604ba5a6ac78962326f06 Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Fri, 13 Jul 2012 20:35:11 -0500 Subject: [PATCH] --- yaml --- r: 320351 b: refs/heads/master c: aa711ee3402ad10ffd5b70ce0417fadc9a95cccf h: refs/heads/master i: 320349: cbd48d8017ade85a87f3950a975332e4104625b1 320347: e38a881f64ea8dedd5891e32c688bfef03d74ec7 320343: f3d28fe4aad61cdf27913593d3760e6f50b2e468 320335: fd692652a1d42a8a6606d1c7b3615e5332176448 320319: c5006ff5220de08442b32ada49eb9b0a361d0c48 v: v3 --- [refs] | 2 +- trunk/fs/ceph/snap.c | 18 ++++++++++-------- trunk/fs/ceph/super.h | 4 ++-- trunk/include/linux/ceph/libceph.h | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 9225e02689cc..99e075c97ce0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bd919d45aa61c19d9ed82548d6deb06bcae31153 +refs/heads/master: aa711ee3402ad10ffd5b70ce0417fadc9a95cccf diff --git a/trunk/fs/ceph/snap.c b/trunk/fs/ceph/snap.c index e5206fc76562..cbb2f54a3019 100644 --- a/trunk/fs/ceph/snap.c +++ b/trunk/fs/ceph/snap.c @@ -296,8 +296,7 @@ static int build_snap_context(struct ceph_snap_realm *realm) struct ceph_snap_realm *parent = realm->parent; struct ceph_snap_context *snapc; int err = 0; - int i; - int num = realm->num_prior_parent_snaps + realm->num_snaps; + u32 num = realm->num_prior_parent_snaps + realm->num_snaps; /* * build parent context, if it hasn't been built. @@ -321,11 +320,11 @@ static int build_snap_context(struct ceph_snap_realm *realm) realm->cached_context->seq == realm->seq && (!parent || realm->cached_context->seq >= parent->cached_context->seq)) { - dout("build_snap_context %llx %p: %p seq %lld (%d snaps)" + dout("build_snap_context %llx %p: %p seq %lld (%u snaps)" " (unchanged)\n", realm->ino, realm, realm->cached_context, realm->cached_context->seq, - realm->cached_context->num_snaps); + (unsigned int) realm->cached_context->num_snaps); return 0; } @@ -342,6 +341,8 @@ static int build_snap_context(struct ceph_snap_realm *realm) num = 0; snapc->seq = realm->seq; if (parent) { + u32 i; + /* include any of parent's snaps occurring _after_ my parent became my parent */ for (i = 0; i < parent->cached_context->num_snaps; i++) @@ -361,8 +362,9 @@ static int build_snap_context(struct ceph_snap_realm *realm) sort(snapc->snaps, num, sizeof(u64), cmpu64_rev, NULL); snapc->num_snaps = num; - dout("build_snap_context %llx %p: %p seq %lld (%d snaps)\n", - realm->ino, realm, snapc, snapc->seq, snapc->num_snaps); + dout("build_snap_context %llx %p: %p seq %lld (%u snaps)\n", + realm->ino, realm, snapc, snapc->seq, + (unsigned int) snapc->num_snaps); if (realm->cached_context) ceph_put_snap_context(realm->cached_context); @@ -402,9 +404,9 @@ static void rebuild_snap_realms(struct ceph_snap_realm *realm) * helper to allocate and decode an array of snapids. free prior * instance, if any. */ -static int dup_array(u64 **dst, __le64 *src, int num) +static int dup_array(u64 **dst, __le64 *src, u32 num) { - int i; + u32 i; kfree(*dst); if (num) { diff --git a/trunk/fs/ceph/super.h b/trunk/fs/ceph/super.h index fc35036d258d..3ea48b7b98b3 100644 --- a/trunk/fs/ceph/super.h +++ b/trunk/fs/ceph/super.h @@ -612,9 +612,9 @@ struct ceph_snap_realm { u64 parent_since; /* snapid when our current parent became so */ u64 *prior_parent_snaps; /* snaps inherited from any parents we */ - int num_prior_parent_snaps; /* had prior to parent_since */ + u32 num_prior_parent_snaps; /* had prior to parent_since */ u64 *snaps; /* snaps specific to this realm */ - int num_snaps; + u32 num_snaps; struct ceph_snap_realm *parent; struct list_head children; /* list of child realms */ diff --git a/trunk/include/linux/ceph/libceph.h b/trunk/include/linux/ceph/libceph.h index ea072e1f9db9..42624789b06f 100644 --- a/trunk/include/linux/ceph/libceph.h +++ b/trunk/include/linux/ceph/libceph.h @@ -154,7 +154,7 @@ struct ceph_client { struct ceph_snap_context { atomic_t nref; u64 seq; - int num_snaps; + u32 num_snaps; u64 snaps[]; };