xfs: fix missing KM_NOFS tags to keep lockdep happy
[firefly-linux-kernel-4.4.55.git] / fs / ceph / snap.c
index cbb2f54a301971cea4e7ed02b029c3e7979cbc18..f01645a27752bfcde801206538728c90463a1e0d 100644 (file)
@@ -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;