diff options
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) | |||
332 | err = -ENOMEM; | 332 | err = -ENOMEM; |
333 | if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64)) | 333 | if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64)) |
334 | goto fail; | 334 | goto fail; |
335 | snapc = kzalloc(sizeof(*snapc) + num*sizeof(u64), GFP_NOFS); | 335 | snapc = ceph_create_snap_context(num, GFP_NOFS); |
336 | if (!snapc) | 336 | if (!snapc) |
337 | goto fail; | 337 | goto fail; |
338 | atomic_set(&snapc->nref, 1); | ||
339 | 338 | ||
340 | /* build (reverse sorted) snap vector */ | 339 | /* build (reverse sorted) snap vector */ |
341 | num = 0; | 340 | num = 0; |