Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/sunrpc/addr.c | size_t rpc_pton(struct net *net, const char *buf, const size_t buflen,
struct sockaddr *sap, const size_t salen) {
unsigned int i;
for (i = 0; i < buflen; i++)
if (buf[i] == ':')
return rpc_pton6(net, buf, buflen, sap, salen);
return rpc_pton4(buf, buflen, sap, salen);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/addr.c | char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags) {
char portbuf[RPCBIND_MAXUADDRPLEN];
char addrbuf[RPCBIND_MAXUADDRLEN];
unsigned short port;
switch (sap->sa_family) {
case AF_INET:
if (rpc_ntop4(sap, addrbuf, sizeof(addrbuf)) == 0)
return NULL;
port = ntohs(((struct socka... | [
1,
0
] |
Linux Kernel | net/sunrpc/addr.c | size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr,
const size_t uaddr_len, struct sockaddr *sap,
const size_t salen) {
char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')];
u8 portlo, porthi;
unsigned short port;
if (uaddr_len > RPCBIND_MAXUADDRLEN)
... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth.c | const struct cred *rpc_machine_cred(void) { return &machine_cred; } | [
0,
0
] |
Linux Kernel | net/sunrpc/auth.c |
struct rpc_auth *rpcauth_create(const struct rpc_auth_create_args *args,
struct rpc_clnt *clnt) {
struct rpc_auth *auth = ERR_PTR(-EINVAL);
const struct rpc_authops *ops;
u32 flavor = pseudoflavor_to_flavor(args->pseudoflavor);
ops = rpcauth_get_authops(flavor);
if (ops == NU... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth.c |
static void rpcauth_lru_add_locked(struct rpc_cred *cred) {
if (!list_empty(&cred->cr_lru))
return;
number_cred_unused++;
list_add_tail(&cred->cr_lru, &cred_unused);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth.c |
static void rpcauth_lru_add(struct rpc_cred *cred) {
if (!list_empty(&cred->cr_lru))
return;
spin_lock(&rpc_credcache_lock);
rpcauth_lru_add_locked(cred);
spin_unlock(&rpc_credcache_lock);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth.c |
static void rpcauth_lru_remove_locked(struct rpc_cred *cred) {
if (list_empty(&cred->cr_lru))
return;
number_cred_unused--;
list_del_init(&cred->cr_lru);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth.c |
static void rpcauth_cache_enforce_limit(void) {
unsigned long diff;
unsigned int nr_to_scan;
if (number_cred_unused <= auth_max_cred_cachesize)
return;
diff = number_cred_unused - auth_max_cred_cachesize;
nr_to_scan = 100;
if (diff < nr_to_scan)
nr_to_scan = diff;
rpcauth_cache_do_shrink(nr_to_s... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth.c |
struct rpc_cred *rpcauth_lookupcred(struct rpc_auth *auth, int flags) {
struct auth_cred acred;
struct rpc_cred *ret;
const struct cred *cred = current_cred();
memset(&acred, 0, sizeof(acred));
acred.cred = cred;
ret = auth->au_ops->lookup_cred(auth, &acred, flags);
return ret;
} | [
1,
0
] |
Linux Kernel | net/sunrpc/auth.c |
static struct rpc_cred *rpcauth_bind_new_cred(struct rpc_task *task,
int lookupflags) {
struct rpc_auth *auth = task->tk_client->cl_auth;
return rpcauth_lookupcred(auth, lookupflags);
} | [
1,
0
] |
Linux Kernel | net/sunrpc/auth.c | int rpcauth_unwrap_resp(struct rpc_task *task, struct xdr_stream *xdr) {
const struct rpc_credops *ops = task->tk_rqstp->rq_cred->cr_ops;
return ops->crunwrap_resp(task, xdr);
} | [
1,
0
] |
Linux Kernel | net/sunrpc/auth.c |
void rpcauth_remove_module(void) {
rpc_destroy_authunix();
unregister_shrinker(&rpc_cred_shrinker);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static void gss_release_msg(struct gss_upcall_msg *gss_msg) {
struct net *net = gss_msg->auth->net;
if (!refcount_dec_and_test(&gss_msg->count))
return;
put_pipe_version(net);
BUG_ON(!list_empty(&gss_msg->list));
if (gss_msg->ctx != NULL)
gss_put_ctx(gss_msg->ctx);
rpc_destroy_wait_queue(&gss_msg->... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static inline struct gss_upcall_msg *
gss_add_msg(struct gss_upcall_msg *gss_msg) {
struct rpc_pipe *pipe = gss_msg->pipe;
struct gss_upcall_msg *old;
spin_lock(&pipe->lock);
old = __gss_find_upcall(pipe, gss_msg->uid, gss_msg->auth);
if (old == NULL) {
refcount_inc(&gss_msg->count);
list_add(&gss_ms... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static void gss_encode_v0_msg(struct gss_upcall_msg *gss_msg,
const struct cred *cred) {
struct user_namespace *userns = cred->user_ns;
uid_t uid = from_kuid_munged(userns, gss_msg->uid);
memcpy(gss_msg->databuf, &uid, sizeof(uid));
gss_msg->msg.data = gss_msg->databuf;
gss_msg... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static void warn_gssd(void) {
dprintk("AUTH_GSS upcall failed. Please check user daemon is running.\n");
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static inline int gss_refresh_upcall(struct rpc_task *task) {
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
struct gss_auth *gss_auth =
container_of(cred->cr_auth, struct gss_auth, rpc_auth);
struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base);
struct gss_upcall_msg *gss_msg;
str... | [
1,
1
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static struct gss_pipe *gss_pipe_alloc(struct rpc_clnt *clnt, const char *name,
const struct rpc_pipe_ops *upcall_ops) {
struct gss_pipe *p;
int err = -ENOMEM;
p = kmalloc(sizeof(*p), GFP_KERNEL);
if (p == NULL)
goto err;
p->pipe = rpc_mkpipe_data(upcall_ops, RPC_P... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static struct rpc_pipe_dir_object *gss_pipe_alloc_pdo(void *data) {
struct gss_pipe *gss_pipe;
struct gss_alloc_pdo *args = data;
gss_pipe = gss_pipe_alloc(args->clnt, args->name, args->upcall_ops);
if (!IS_ERR(gss_pipe))
return &gss_pipe->pdo;
return NULL;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static void __gss_pipe_release(struct kref *kref) {
struct gss_pipe *p = container_of(kref, struct gss_pipe, kref);
__gss_pipe_free(p);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static void gss_pipe_free(struct gss_pipe *p) {
if (p != NULL)
kref_put(&p->kref, __gss_pipe_release);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static struct gss_auth *
gss_auth_find_or_add_hashed(const struct rpc_auth_create_args *args,
struct rpc_clnt *clnt, struct gss_auth *new) {
struct gss_auth *gss_auth;
unsigned long hashval = (unsigned long)clnt;
spin_lock(&gss_auth_hash_lock);
hash_for_each_possible(gss_auth_hash_t... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static struct gss_auth *
gss_create_hashed(const struct rpc_auth_create_args *args,
struct rpc_clnt *clnt) {
struct gss_auth *gss_auth;
struct gss_auth *new;
gss_auth = gss_auth_find_or_add_hashed(args, clnt, NULL);
if (gss_auth != NULL)
goto out;
new = gss_create_new(args, clnt);
if... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static void gss_destroy_cred(struct rpc_cred *cred) {
if (test_and_clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0)
gss_send_destroy_context(cred);
gss_destroy_nullcred(cred);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static struct rpc_cred *gss_create_cred(struct rpc_auth *auth,
struct auth_cred *acred, int flags,
gfp_t gfp) {
struct gss_auth *gss_auth = container_of(auth, struct gss_auth, rpc_auth);
struct gss_cred *cred = NULL;
int err = -ENOMEM... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static int gss_refresh(struct rpc_task *task) {
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
int ret = 0;
if (gss_cred_is_negative_entry(cred))
return -EKEYEXPIRED;
if (!test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags) &&
!test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags)) {
ret = gss_renew_cred(t... | [
1,
1
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static int gss_validate(struct rpc_task *task, struct xdr_stream *xdr) {
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
__be32 *p, *seq = NULL;
struct kvec iov;
struct xdr_buf verf_buf;
struct xdr_netobj mic;
u32 len, maj_stat;
int status;
p = xdr_in... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c |
static void priv_release_snd_buf(struct rpc_rqst *rqstp) {
int i;
for (i = 0; i < rqstp->rq_enc_pages_num; i++)
__free_page(rqstp->rq_enc_pages[i]);
kfree(rqstp->rq_enc_pages);
rqstp->rq_release_snd_buf = NULL;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static void gss_update_rslack(struct rpc_task *task, struct rpc_cred *cred,
unsigned int before, unsigned int after) {
struct rpc_auth *auth = cred->cr_auth;
if (test_and_clear_bit(RPCAUTH_AUTH_UPDATE_SLACK, &auth->au_flags)) {
auth->au_ralign = auth->au_verfsize + before;
aut... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static int __init init_rpcsec_gss(void) {
int err = 0;
err = rpcauth_register(&authgss_ops);
if (err)
goto out;
err = gss_svc_init();
if (err)
goto out_unregister;
err = register_pernet_subsys(&rpcsec_gss_net_ops);
if (err)
goto out_svc_exit;
rpc_init_wait_queue(&pipe_version_rpc_waitqueue,... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss.c | static void __exit exit_rpcsec_gss(void) {
unregister_pernet_subsys(&rpcsec_gss_net_ops);
gss_svc_shutdown();
rpcauth_unregister(&authgss_ops);
rcu_barrier();
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/auth_gss_internal.h |
static inline const void *simple_get_bytes(const void *p, const void *end,
void *res, size_t len) {
const void *q = (const void *)((const char *)p + len);
if (unlikely(q > end || q < p))
return ERR_PTR(-EFAULT);
memcpy(res, p, len);
return q;
} | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_crypto.c |
u32 krb5_encrypt(struct crypto_sync_skcipher *tfm, void *iv, void *in,
void *out, int length) {
u32 ret = -EINVAL;
struct scatterlist sg[1];
u8 local_iv[GSS_KRB5_MAX_BLOCKSIZE] = {0};
SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
if (length % crypto_sync_skcipher_blocksize(tfm) != 0)
goto o... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_crypto.c |
u32 krb5_decrypt(struct crypto_sync_skcipher *tfm, void *iv, void *in,
void *out, int length) {
u32 ret = -EINVAL;
struct scatterlist sg[1];
u8 local_iv[GSS_KRB5_MAX_BLOCKSIZE] = {0};
SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
if (length % crypto_sync_skcipher_blocksize(tfm) != 0)
goto o... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_crypto.c |
int gss_encrypt_xdr_buf(struct crypto_sync_skcipher *tfm, struct xdr_buf *buf,
int offset, struct page **pages) {
int ret;
struct encryptor_desc desc;
SYNC_SKCIPHER_REQUEST_ON_STACK(req, tfm);
BUG_ON((buf->len - offset) % crypto_sync_skcipher_blocksize(tfm) != 0);
skcipher_request_s... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_keys.c | static void krb5_nfold(u32 inbits, const u8 *in, u32 outbits, u8 *out) {
unsigned long ulcm;
int byte, i, msbit;
inbits >>= 3;
outbits >>= 3;
/* first compute lcm(n,k) */
ulcm = lcm(inbits, outbits);
/* now do the real work */
memset(out, 0, outbits);
byte = 0;
/* this will end up cycling throu... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_keys.c |
static void mit_des_fixup_key_parity(u8 key[8]) {
int i;
for (i = 0; i < 8; i++) {
key[i] &= 0xfe;
key[i] |= 1 ^ parity_char(key[i]);
}
} | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_mech.c |
static int __init init_kerberos_module(void) {
int status;
status = gss_mech_register(&gss_kerberos_mech);
if (status)
printk("Failed to register kerberos gss mechanism!\n");
return status;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_seal.c |
static u32 gss_get_mic_v1(struct krb5_ctx *ctx, struct xdr_buf *text,
struct xdr_netobj *token) {
char cksumdata[GSS_KRB5_MAX_CKSUM_LEN];
struct xdr_netobj md5cksum = {.len = sizeof(cksumdata), .data = cksumdata};
void *ptr;
time64_t now;
u32 seq_send;
u8 *cksumkey;
dprintk("RP... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_seqnum.c |
s32 krb5_make_seq_num(struct krb5_ctx *kctx, struct crypto_sync_skcipher *key,
int direction, u32 seqnum, unsigned char *cksum,
unsigned char *buf) {
unsigned char *plain;
s32 code;
plain = kmalloc(8, GFP_KERNEL);
if (!plain)
return -ENOMEM;
plain[0] = (unsig... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_krb5_wrap.c | void gss_krb5_make_confounder(char *p, u32 conflen) {
static u64 i = 0;
u64 *q = (u64 *)p;
/* initialize to random value */
if (i == 0) {
i = get_random_u32();
i = (i << 32) | get_random_u32();
}
switch (conflen) {
case 16:
*q++ = i++;
fallthrough;
case 8:
*q++ = i++;
break;
... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_mech_switch.c |
struct gss_api_mech *gss_mech_get(struct gss_api_mech *gm) {
__module_get(gm->gm_owner);
return gm;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_mech_switch.c | rpc_authflavor_t gss_mech_info2flavor(struct rpcsec_gss_info *info) {
rpc_authflavor_t pseudoflavor;
struct gss_api_mech *gm;
gm = gss_mech_get_by_OID(&info->oid);
if (gm == NULL)
return RPC_AUTH_MAXFLAVOR;
pseudoflavor = gss_svc_to_pseudoflavor(gm, info->qop, info->service);
gss_mech_put(gm);
retu... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_mech_switch.c |
bool gss_pseudoflavor_to_datatouch(struct gss_api_mech *gm, u32 pseudoflavor) {
int i;
for (i = 0; i < gm->gm_pf_num; i++) {
if (gm->gm_pfs[i].pseudoflavor == pseudoflavor)
return gm->gm_pfs[i].datatouch;
}
return false;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_mech_switch.c | u32 gss_verify_mic(struct gss_ctx *context_handle, struct xdr_buf *message,
struct xdr_netobj *mic_token) {
return context_handle->mech_type->gm_ops->gss_verify_mic(context_handle,
message, mic_token);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_mech_switch.c |
u32 gss_unwrap(struct gss_ctx *ctx_id, int offset, int len,
struct xdr_buf *buf) {
return ctx_id->mech_type->gm_ops->gss_unwrap(ctx_id, offset, len, buf);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_upcall.c |
static struct rpc_clnt *get_gssp_clnt(struct sunrpc_net *sn) {
struct rpc_clnt *clnt;
mutex_lock(&sn->gssp_lock);
clnt = sn->gssp_clnt;
if (clnt)
refcount_inc(&clnt->cl_count);
mutex_unlock(&sn->gssp_lock);
return clnt;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_upcall.c |
static char *gssp_stringify(struct xdr_netobj *netobj) {
return kmemdup_nul(netobj->data, netobj->len, GFP_KERNEL);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_xdr.c |
static int gssx_dec_bool(struct xdr_stream *xdr, u32 *v) {
__be32 *p;
p = xdr_inline_decode(xdr, 4);
if (unlikely(p == NULL))
return -ENOSPC;
*v = be32_to_cpu(*p);
return 0;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_xdr.c | static int gssx_dec_buffer(struct xdr_stream *xdr, gssx_buffer *buf) {
u32 length;
__be32 *p;
p = xdr_inline_decode(xdr, 4);
if (unlikely(p == NULL))
return -ENOSPC;
length = be32_to_cpup(p);
p = xdr_inline_decode(xdr, length);
if (unlikely(p == NULL))
return -ENOSPC;
if (buf->len == 0) {
... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_xdr.c |
static int gssx_enc_option(struct xdr_stream *xdr, struct gssx_option *opt) {
int err;
err = gssx_enc_buffer(xdr, &opt->option);
if (err)
return err;
err = gssx_enc_buffer(xdr, &opt->value);
return err;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_xdr.c |
static int dummy_enc_opt_array(struct xdr_stream *xdr,
const struct gssx_option_array *oa) {
__be32 *p;
if (oa->count != 0)
return -EINVAL;
p = xdr_reserve_space(xdr, 4);
if (!p)
return -ENOSPC;
*p = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_xdr.c |
static int dummy_dec_opt_array(struct xdr_stream *xdr,
struct gssx_option_array *oa) {
struct gssx_option dummy;
u32 count, i;
__be32 *p;
p = xdr_inline_decode(xdr, 4);
if (unlikely(p == NULL))
return -ENOSPC;
count = be32_to_cpup(p++);
memset(&dummy, 0, sizeof(dummy))... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_xdr.c | static int gssx_dec_name(struct xdr_stream *xdr, struct gssx_name *name) {
struct xdr_netobj dummy_netobj = {.len = 0};
struct gssx_name_attr_array dummy_name_attr_array = {.count = 0};
struct gssx_option_array dummy_option_array = {.count = 0};
int err;
err = gssx_dec_buffer(xdr, &name->display_name);
if ... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/gss_rpc_xdr.c | static int gssx_dec_ctx(struct xdr_stream *xdr, struct gssx_ctx *ctx) {
__be32 *p;
int err;
err = gssx_dec_buffer(xdr, &ctx->exported_context_token);
if (err)
return err;
/* ctx->state */
err = gssx_dec_buffer(xdr, &ctx->state);
if (err)
return err;
/* ctx->need_release */
err = gssx_dec_bo... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static void rsi_free_rcu(struct rcu_head *head) {
struct rsi *rsii = container_of(head, struct rsi, rcu_head);
rsi_free(rsii);
kfree(rsii);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static void update_rsi(struct cache_head *cnew, struct cache_head *citem) {
struct rsi *new = container_of(cnew, struct rsi, h);
struct rsi *item = container_of(citem, struct rsi, h);
BUG_ON(new->out_handle.data || new->out_token.data);
new->out_handle.len = item->out_handle.len;
item->out_handle.len = 0;
... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static int rsi_upcall(struct cache_detail *cd, struct cache_head *h) {
return sunrpc_cache_pipe_upcall_timeout(cd, h);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static struct rsi *rsi_lookup(struct cache_detail *cd, struct rsi *item) {
struct cache_head *ch;
int hash = rsi_hash(item);
ch = sunrpc_cache_lookup_rcu(cd, &item->h, hash);
if (ch)
return container_of(ch, struct rsi, h);
else
return NULL;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static void rsc_put(struct kref *ref) {
struct rsc *rsci = container_of(ref, struct rsc, h.ref);
if (rsci->mechctx)
gss_delete_sec_context(&rsci->mechctx);
free_svc_cred(&rsci->cred);
call_rcu(&rsci->rcu_head, rsc_free_rcu);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static inline int rsc_hash(struct rsc *rsci) {
return hash_mem(rsci->handle.data, rsci->handle.len, RSC_HASHBITS);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static struct rsc *gss_svc_searchbyctx(struct cache_detail *cd,
struct xdr_netobj *handle) {
struct rsc rsci;
struct rsc *found;
memset(&rsci, 0, sizeof(rsci));
if (dup_to_netobj(&rsci.handle, handle->data, handle->len))
return NULL;
found = rsc_lookup(cd, &rsci);... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c | static int gss_write_null_verf(struct svc_rqst *rqstp) {
__be32 *p;
svc_putnl(rqstp->rq_res.head, RPC_AUTH_NULL);
p = rqstp->rq_res.head->iov_base + rqstp->rq_res.head->iov_len;
*p++ = 0;
if (!xdr_ressize_check(rqstp, p))
return -1;
return 0;
} | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
static int create_use_gss_proxy_proc_entry(struct net *net) {
struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
struct proc_dir_entry **p = &sn->use_gssp_proc;
sn->use_gss_proxy = -1;
*p = proc_create_data("use-gss-proxy", S_IFREG | 0600, sn->proc_net_rpc,
&use_gss_proxy_proc_op... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_gss/svcauth_gss.c |
void gss_svc_shutdown_net(struct net *net) {
destroy_use_gss_proxy_proc_entry(net);
rsi_cache_destroy_net(net);
rsc_cache_destroy_net(net);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_null.c |
static void nul_destroy(struct rpc_auth *auth) {} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_null.c | static int nul_marshal(struct rpc_task *task, struct xdr_stream *xdr) {
__be32 *p;
p = xdr_reserve_space(xdr, 4 * sizeof(*p));
if (!p)
return -EMSGSIZE;
*p++ = rpc_auth_null;
*p++ = xdr_zero;
/* Verifier */
*p++ = rpc_auth_null;
*p = xdr_zero;
return 0;
} | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_unix.c |
static struct rpc_auth *unx_create(const struct rpc_auth_create_args *args,
struct rpc_clnt *clnt) {
refcount_inc(&unix_auth.au_count);
return &unix_auth;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_unix.c | static struct rpc_cred *unx_lookup_cred(struct rpc_auth *auth,
struct auth_cred *acred, int flags) {
struct rpc_cred *ret;
ret = kmalloc(sizeof(*ret), rpc_task_gfp_mask());
if (!ret) {
if (!(flags & RPCAUTH_LOOKUP_ASYNC))
return ERR_PTR(-ENOMEM);
ret = mempoo... | [
0,
0
] |
Linux Kernel | net/sunrpc/auth_unix.c | static int unx_marshal(struct rpc_task *task, struct xdr_stream *xdr) {
struct rpc_clnt *clnt = task->tk_client;
struct rpc_cred *cred = task->tk_rqstp->rq_cred;
__be32 *p, *cred_len, *gidarr_len;
int i;
struct group_info *gi = cred->cr_cred->group_info;
struct user_namespace *userns =
clnt->cl_cred ?... | [
1,
0
] |
Linux Kernel | net/sunrpc/auth_unix.c | static int unx_refresh(struct rpc_task *task) {
set_bit(RPCAUTH_CRED_UPTODATE, &task->tk_rqstp->rq_cred->cr_flags);
return 0;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/backchannel_rqst.c |
unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt) { return BC_MAX_SLOTS; } | [
0,
0
] |
Linux Kernel | net/sunrpc/backchannel_rqst.c | static struct rpc_rqst *xprt_alloc_bc_req(struct rpc_xprt *xprt) {
gfp_t gfp_flags = GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN;
struct rpc_rqst *req;
req = kzalloc(sizeof(*req), gfp_flags);
if (req == NULL)
return NULL;
req->rq_xprt = xprt;
INIT_LIST_HEAD(&req->rq_bc_list);
/* Preallocate one XDR r... | [
0,
0
] |
Linux Kernel | net/sunrpc/backchannel_rqst.c |
void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs) {
struct rpc_rqst *req = NULL, *tmp = NULL;
dprintk("RPC: destroy backchannel transport\n");
if (max_reqs == 0)
goto out;
spin_lock_bh(&xprt->bc_pa_lock);
xprt->bc_alloc_max -= min(max_reqs, xprt->bc_alloc_max);
list_for_each_... | [
0,
0
] |
Linux Kernel | net/sunrpc/backchannel_rqst.c |
static struct rpc_rqst *xprt_get_bc_request(struct rpc_xprt *xprt, __be32 xid,
struct rpc_rqst *new) {
struct rpc_rqst *req = NULL;
dprintk("RPC: allocate a backchannel request\n");
if (list_empty(&xprt->bc_pa_list)) {
if (!new)
goto not_found;
if ... | [
1,
0
] |
Linux Kernel | net/sunrpc/backchannel_rqst.c | void xprt_free_bc_rqst(struct rpc_rqst *req) {
struct rpc_xprt *xprt = req->rq_xprt;
dprintk("RPC: free backchannel req=%p\n", req);
req->rq_connect_cookie = xprt->connect_cookie - 1;
smp_mb__before_atomic();
clear_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
smp_mb__after_atomic();
spin_lock_bh(... | [
1,
0
] |
Linux Kernel | net/sunrpc/backchannel_rqst.c | void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied) {
struct rpc_xprt *xprt = req->rq_xprt;
struct svc_serv *bc_serv = xprt->bc_serv;
spin_lock(&xprt->bc_pa_lock);
list_del(&req->rq_bc_pa_list);
xprt->bc_alloc_count--;
spin_unlock(&xprt->bc_pa_lock);
req->rq_private_buf.len = copied;
... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | static void sunrpc_begin_cache_remove_entry(struct cache_head *ch,
struct cache_detail *cd) {
hlist_del_init_rcu(&ch->cache_list);
set_bit(CACHE_CLEANED, &ch->flags);
cd->entries--;
} | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | static void do_cache_clean(struct work_struct *work) {
int delay;
if (list_empty(&cache_list))
return;
if (cache_clean() == -1)
delay = round_jiffies_relative(30 * HZ);
else
delay = 5;
queue_delayed_work(system_power_efficient_wq, &cache_cleaner, delay);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | void cache_flush(void) {
while (cache_clean() != -1)
cond_resched();
while (cache_clean() != -1)
cond_resched();
} | [
1,
0
] |
Linux Kernel | net/sunrpc/cache.c |
void cache_purge(struct cache_detail *detail) {
struct cache_head *ch = NULL;
struct hlist_head *head = NULL;
int i = 0;
spin_lock(&detail->hash_lock);
if (!detail->entries) {
spin_unlock(&detail->hash_lock);
return;
}
dprintk("RPC: %d entries in %s cache\n", detail->entries, detail->name);
f... | [
1,
0
] |
Linux Kernel | net/sunrpc/cache.c |
static void setup_deferral(struct cache_deferred_req *dreq,
struct cache_head *item, int count_me) {
dreq->item = item;
spin_lock(&cache_defer_lock);
__hash_deferred_req(dreq, item);
if (count_me) {
cache_defer_cnt++;
list_add(&dreq->recent, &cache_defer_list);
}
spi... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | static inline bool cache_defer_immediately(void) {
return !fail_sunrpc.ignore_cache_wait && should_fail(&fail_sunrpc.attr, 1);
}
#else | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | static inline bool cache_defer_immediately(void) { return false; }
#endif | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c |
void cache_clean_deferred(void *owner) {
struct cache_deferred_req *dreq, *tmp;
struct list_head pending;
INIT_LIST_HEAD(&pending);
spin_lock(&cache_defer_lock);
list_for_each_entry_safe(dreq, tmp, &cache_defer_list, recent) {
if (dreq->owner == owner) {
__unhash_deferred_req(dreq);
list_ad... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | static int cache_ioctl(struct inode *ino, struct file *filp, unsigned int cmd,
unsigned long arg, struct cache_detail *cd) {
int len = 0;
struct cache_reader *rp = filp->private_data;
struct cache_queue *cq;
if (cmd != FIONREAD || !rp)
return -EINVAL;
spin_lock(&queue_lock);
fo... | [
1,
0
] |
Linux Kernel | net/sunrpc/cache.c |
static int cache_open(struct inode *inode, struct file *filp,
struct cache_detail *cd) {
struct cache_reader *rp = NULL;
if (!cd || !try_module_get(cd->owner))
return -EACCES;
nonseekable_open(inode, filp);
if (filp->f_mode & FMODE_READ) {
rp = kmalloc(sizeof(*rp), GFP_KERNEL);
... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c |
static int cache_release(struct inode *inode, struct file *filp,
struct cache_detail *cd) {
struct cache_reader *rp = filp->private_data;
if (rp) {
spin_lock(&queue_lock);
if (rp->offset) {
struct cache_queue *cq;
for (cq = &rp->q; &cq->list != &cd->queue;
c... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | static bool cache_listeners_exist(struct cache_detail *detail) {
if (atomic_read(&detail->writers))
return true;
if (detail->last_close == 0)
return false;
if (detail->last_close < seconds_since_boot() - 30)
/*
* We allow for the possibility that someone might
* restart a userspace daemon w... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | static int cache_pipe_upcall(struct cache_detail *detail,
struct cache_head *h) {
char *buf;
struct cache_request *crq;
int ret = 0;
if (test_bit(CACHE_CLEANED, &h->flags))
return -EAGAIN;
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf)
return -EAGAIN;
crq = kmallo... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c |
int sunrpc_cache_pipe_upcall(struct cache_detail *detail,
struct cache_head *h) {
if (test_and_set_bit(CACHE_PENDING, &h->flags))
return 0;
return cache_pipe_upcall(detail, h);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c | int qword_get(char **bpp, char *dest, int bufsize) {
char *bp = *bpp;
int len = 0;
while (*bp == ' ')
bp++;
if (bp[0] == '\\' && bp[1] == 'x') {
/* HEX STRING */
bp += 2;
while (len < bufsize - 1) {
int h, l;
h = hex_to_bin(bp[0]);
if (h < 0)
break;
l = hex_t... | [
1,
0
] |
Linux Kernel | net/sunrpc/cache.c | static void *__cache_seq_start(struct seq_file *m, loff_t *pos) {
loff_t n = *pos;
unsigned int hash, entry;
struct cache_head *ch;
struct cache_detail *cd = m->private;
if (!n--)
return SEQ_START_TOKEN;
hash = n >> 32;
entry = n & ((1LL << 32) - 1);
hlist_for_each_entry_rcu(ch, &cd->hash_table[ha... | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c |
void *cache_seq_next_rcu(struct seq_file *file, void *p, loff_t *pos) {
return cache_seq_next(file, p, pos);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c |
static ssize_t read_flush(struct file *file, char __user *buf, size_t count,
loff_t *ppos, struct cache_detail *cd) {
char tbuf[22];
size_t len;
len = snprintf(tbuf, sizeof(tbuf), "%llu\n",
convert_to_wallclock(cd->flush_time));
return simple_read_from_buffer(buf, co... | [
1,
0
] |
Linux Kernel | net/sunrpc/cache.c | static ssize_t write_flush(struct file *file, const char __user *buf,
size_t count, loff_t *ppos,
struct cache_detail *cd) {
char tbuf[20];
char *ep;
time64_t now;
if (*ppos || count > sizeof(tbuf) - 1)
return -EINVAL;
if (copy_from_user(tbuf, buf, co... | [
1,
0
] |
Linux Kernel | net/sunrpc/cache.c |
static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
size_t count, loff_t *ppos) {
struct cache_detail *cd = pde_data(file_inode(filp));
return cache_read(filp, buf, count, ppos, cd);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c |
static int cache_open_procfs(struct inode *inode, struct file *filp) {
struct cache_detail *cd = pde_data(inode);
return cache_open(inode, filp, cd);
} | [
0,
0
] |
Linux Kernel | net/sunrpc/cache.c |
static int content_open_procfs(struct inode *inode, struct file *filp) {
struct cache_detail *cd = pde_data(inode);
return content_open(inode, filp, cd);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.