summaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-07-14 03:35:11 +0200
committerSage Weil <sage@inktank.com>2012-07-31 03:15:47 +0200
commitaa711ee3402ad10ffd5b70ce0417fadc9a95cccf (patch)
tree2400f84b9bc87fbd989844c4e2462809f69e9a96 /fs/ceph/super.h
parentrbd: clean up a few dout() calls (diff)
downloadlinux-aa711ee3402ad10ffd5b70ce0417fadc9a95cccf.tar.xz
linux-aa711ee3402ad10ffd5b70ce0417fadc9a95cccf.zip
ceph: define snap counts as u32 everywhere
There are two structures in which a count of snapshots are maintained: struct ceph_snap_context { ... u32 num_snaps; ... } and struct ceph_snap_realm { ... u32 num_prior_parent_snaps; /* had prior to parent_since */ ... u32 num_snaps; ... } These fields never take on negative values (e.g., to hold special meaning), and so are really inherently unsigned. Furthermore they take their value from over-the-wire or on-disk formatted 32-bit values. So change their definition to have type u32, and change some spots elsewhere in the code to account for this change. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r--fs/ceph/super.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index fc35036d258d..3ea48b7b98b3 100644
--- a/fs/ceph/super.h
+++ b/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 */