cregit-Linux how code gets into the kernel

Release 4.14 net/ceph/buffer.c

Directory: net/ceph
// SPDX-License-Identifier: GPL-2.0

#include <linux/ceph/ceph_debug.h>

#include <linux/module.h>
#include <linux/slab.h>

#include <linux/ceph/buffer.h>
#include <linux/ceph/decode.h>
#include <linux/ceph/libceph.h> /* for ceph_kvmalloc */


struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp) { struct ceph_buffer *b; b = kmalloc(sizeof(*b), gfp); if (!b) return NULL; b->vec.iov_base = ceph_kvmalloc(len, gfp); if (!b->vec.iov_base) { kfree(b); return NULL; } kref_init(&b->kref); b->alloc_len = len; b->vec.iov_len = len; dout("buffer_new %p\n", b); return b; }

Contributors

PersonTokensPropCommitsCommitProp
Sage Weil10299.03%266.67%
Ilya Dryomov10.97%133.33%
Total103100.00%3100.00%

EXPORT_SYMBOL(ceph_buffer_new);
void ceph_buffer_release(struct kref *kref) { struct ceph_buffer *b = container_of(kref, struct ceph_buffer, kref); dout("buffer_release %p\n", b); kvfree(b->vec.iov_base); kfree(b); }

Contributors

PersonTokensPropCommitsCommitProp
Sage Weil4597.83%266.67%
Ilya Dryomov12.17%133.33%
Total46100.00%3100.00%

EXPORT_SYMBOL(ceph_buffer_release);
int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end) { size_t len; ceph_decode_need(p, end, sizeof(u32), bad); len = ceph_decode_32(p); dout("decode_buffer len %d\n", (int)len); ceph_decode_need(p, end, len, bad); *b = ceph_buffer_new(len, GFP_NOFS); if (!*b) return -ENOMEM; ceph_decode_copy(p, (*b)->vec.iov_base, len); return 0; bad: return -EINVAL; }

Contributors

PersonTokensPropCommitsCommitProp
Sage Weil110100.00%1100.00%
Total110100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Sage Weil26391.00%444.44%
Yehuda Sadeh Weinraub165.54%111.11%
Ilya Dryomov62.08%222.22%
Tejun Heo31.04%111.11%
Greg Kroah-Hartman10.35%111.11%
Total289100.00%9100.00%
Directory: net/ceph
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.