diff options
author | Alex Elder <elder@inktank.com> | 2013-04-30 07:44:32 +0200 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 06:20:09 +0200 |
commit | 812164f8c3f6f5348aa69003a2f81775c2872ac0 (patch) | |
tree | 55b322ee4736ea34d6aae6527146aabe872a4cd3 /fs/ceph/snap.c | |
parent | libceph: create source file "net/ceph/snapshot.c" (diff) | |
download | linux-812164f8c3f6f5348aa69003a2f81775c2872ac0.tar.xz linux-812164f8c3f6f5348aa69003a2f81775c2872ac0.zip |
ceph: use ceph_create_snap_context()
Now that we have a library routine to create snap contexts, use it.
This is part of:
http://tracker.ceph.com/issues/4857
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r-- | fs/ceph/snap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index cbb2f54a3019..f01645a27752 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -332,10 +332,9 @@ static int build_snap_context(struct ceph_snap_realm *realm) err = -ENOMEM; if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64)) goto fail; - snapc = kzalloc(sizeof(*snapc) + num*sizeof(u64), GFP_NOFS); + snapc = ceph_create_snap_context(num, GFP_NOFS); if (!snapc) goto fail; - atomic_set(&snapc->nref, 1); /* build (reverse sorted) snap vector */ num = 0; |