cregit-Linux how code gets into the kernel

Release 4.8 net/ceph/auth_none.c

Directory: net/ceph
#include <linux/ceph/ceph_debug.h>

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

#include <linux/ceph/decode.h>
#include <linux/ceph/auth.h>

#include "auth_none.h"


static void reset(struct ceph_auth_client *ac) { struct ceph_auth_none_info *xi = ac->private; xi->starting = true; }

Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil26100.00%1100.00%
Total26100.00%1100.00%


static void destroy(struct ceph_auth_client *ac) { kfree(ac->private); ac->private = NULL; }

Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil24100.00%1100.00%
Total24100.00%1100.00%


static int is_authenticated(struct ceph_auth_client *ac) { struct ceph_auth_none_info *xi = ac->private; return !xi->starting; }

Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil26100.00%1100.00%
Total26100.00%1100.00%


static int should_authenticate(struct ceph_auth_client *ac) { struct ceph_auth_none_info *xi = ac->private; return xi->starting; }

Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil25100.00%1100.00%
Total25100.00%1100.00%


static int ceph_auth_none_build_authorizer(struct ceph_auth_client *ac, struct ceph_none_authorizer *au) { void *p = au->buf; void *const end = p + sizeof(au->buf); int ret; ceph_encode_8_safe(&p, end, 1, e_range); ret = ceph_entity_name_encode(ac->name, &p, end); if (ret < 0) return ret; ceph_encode_64_safe(&p, end, ac->global_id, e_range); au->buf_len = p - (void *)au->buf; dout("%s built authorizer len %d\n", __func__, au->buf_len); return 0; e_range: return -ERANGE; }

Contributors

PersonTokensPropCommitsCommitProp
ilya dryomovilya dryomov124100.00%1100.00%
Total124100.00%1100.00%


static int build_request(struct ceph_auth_client *ac, void *buf, void *end) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
tyler hickstyler hicks22100.00%1100.00%
Total22100.00%1100.00%

/* * the generic auth code decode the global_id, and we carry no actual * authenticate state, so nothing happens here. */
static int handle_reply(struct ceph_auth_client *ac, int result, void *buf, void *end) { struct ceph_auth_none_info *xi = ac->private; xi->starting = false; return result; }

Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil40100.00%1100.00%
Total40100.00%1100.00%


static void ceph_auth_none_destroy_authorizer(struct ceph_authorizer *a) { kfree(a); }

Contributors

PersonTokensPropCommitsCommitProp
ilya dryomovilya dryomov16100.00%1100.00%
Total16100.00%1100.00%

/* * build an 'authorizer' with our entity_name and global_id. it is * identical for all services we connect to. */
static int ceph_auth_none_create_authorizer( struct ceph_auth_client *ac, int peer_type, struct ceph_auth_handshake *auth) { struct ceph_none_authorizer *au; int ret; au = kmalloc(sizeof(*au), GFP_NOFS); if (!au) return -ENOMEM; au->base.destroy = ceph_auth_none_destroy_authorizer; ret = ceph_auth_none_build_authorizer(ac, au); if (ret) { kfree(au); return ret; } auth->authorizer = (struct ceph_authorizer *) au; auth->authorizer_buf = au->buf; auth->authorizer_buf_len = au->buf_len; auth->authorizer_reply_buf = au->reply_buf; auth->authorizer_reply_buf_len = sizeof (au->reply_buf); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil8465.12%250.00%
ilya dryomovilya dryomov2821.71%125.00%
alex elderalex elder1713.18%125.00%
Total129100.00%4100.00%

static const struct ceph_auth_client_ops ceph_auth_none_ops = { .name = "none", .reset = reset, .destroy = destroy, .is_authenticated = is_authenticated, .should_authenticate = should_authenticate, .build_request = build_request, .handle_reply = handle_reply, .create_authorizer = ceph_auth_none_create_authorizer, };
int ceph_auth_none_init(struct ceph_auth_client *ac) { struct ceph_auth_none_info *xi; dout("ceph_auth_none_init %p\n", ac); xi = kzalloc(sizeof(*xi), GFP_NOFS); if (!xi) return -ENOMEM; xi->starting = true; ac->protocol = CEPH_AUTH_NONE; ac->private = xi; ac->ops = &ceph_auth_none_ops; return 0; }

Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil72100.00%1100.00%
Total72100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
sage weilsage weil35861.94%444.44%
ilya dryomovilya dryomov16929.24%111.11%
tyler hickstyler hicks274.67%111.11%
alex elderalex elder172.94%111.11%
yehuda sadehyehuda sadeh40.69%111.11%
tejun heotejun heo30.52%111.11%
Total578100.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.