Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/unix/af_unix.c |
static unsigned int unix_abstract_hash(struct sockaddr_un *sunaddr,
int addr_len, int type) {
__wsum csum = csum_partial(sunaddr, addr_len, 0);
unsigned int hash;
hash = (__force unsigned int)csum_fold(csum);
hash ^= hash >> 8;
hash ^= type;
return UNIX_HASH_MOD + 1... | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static inline bool unix_secdata_eq(struct scm_cookie *scm,
struct sk_buff *skb) {
return (scm->secid == UNIXCB(skb).secid);
}
#else | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c | static inline void unix_get_secdata(struct scm_cookie *scm,
struct sk_buff *skb) {} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static inline int unix_our_peer(struct sock *sk, struct sock *osk) {
return unix_peer(osk) == sk;
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void __unix_remove_socket(struct sock *sk) { sk_del_node_init(sk); } | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void __unix_insert_socket(struct net *net, struct sock *sk) {
DEBUG_NET_WARN_ON_ONCE(!sk_unhashed(sk));
sk_add_node(sk, &net->unx.table.buckets[sk->sk_hash]);
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void unix_remove_socket(struct net *net, struct sock *sk) {
spin_lock(&net->unx.table.locks[sk->sk_hash]);
__unix_remove_socket(sk);
spin_unlock(&net->unx.table.locks[sk->sk_hash]);
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void unix_insert_unbound_socket(struct net *net, struct sock *sk) {
spin_lock(&net->unx.table.locks[sk->sk_hash]);
__unix_insert_socket(net, sk);
spin_unlock(&net->unx.table.locks[sk->sk_hash]);
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c | static int unix_dgram_peer_wake_relay(wait_queue_entry_t *q, unsigned mode,
int flags, void *key) {
struct unix_sock *u;
wait_queue_head_t *u_sleep;
u = container_of(q, struct unix_sock, peer_wake);
__remove_wait_queue(&unix_sk(u->peer_wake.private)->peer_wait, q);
u->p... | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void unix_dgram_peer_wake_disconnect(struct sock *sk,
struct sock *other) {
struct unix_sock *u, *u_other;
u = unix_sk(sk);
u_other = unix_sk(other);
spin_lock(&u_other->peer_wait.lock);
if (u->peer_wake.private == other) {
__remove_wait_queue(&u_other... | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void unix_dgram_peer_wake_disconnect_wakeup(struct sock *sk,
struct sock *other) {
unix_dgram_peer_wake_disconnect(sk, other);
wake_up_interruptible_poll(sk_sleep(sk),
EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND);
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c | static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other) {
int connected;
connected = unix_dgram_peer_wake_connect(sk, other);
if (unix_recvq_full_lockless(other) && !sock_flag(other, SOCK_DEAD))
return 1;
if (connected)
unix_dgram_peer_wake_disconnect(sk, other);
return 0;
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static int unix_writable(const struct sock *sk) {
return sk->sk_state != TCP_LISTEN &&
(refcount_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
} | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c | static struct sock *unix_create1(struct net *net, struct socket *sock, int kern,
int type) {
struct unix_sock *u;
struct sock *sk;
int err;
atomic_long_inc(&unix_nr_socks);
if (atomic_long_read(&unix_nr_socks) > 2 * get_max_files()) {
err = -ENFILE;
goto err;
}
i... | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c |
static int unix_release(struct socket *sock) {
struct sock *sk = sock->sk;
if (!sk)
return 0;
sk->sk_prot->close(sk, 0);
unix_release_sock(sk, 0);
sock->sk = NULL;
return 0;
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static long unix_wait_for_peer(struct sock *other, long timeo)
__releases(&unix_sk(other)->lock) | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static int unix_getname(struct socket *sock, struct sockaddr *uaddr, int peer) {
struct sock *sk = sock->sk;
struct unix_address *addr;
DECLARE_SOCKADDR(struct sockaddr_un *, sunaddr, uaddr);
int err = 0;
if (peer) {
sk = unix_peer_get(sk);
err = -ENOTCONN;
if (!sk)
goto out;
err = 0... | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c |
static int maybe_init_creds(struct scm_cookie *scm, struct socket *socket,
const struct sock *other) {
int err;
struct msghdr msg = {.msg_controllen = 0};
err = scm_send(socket, &msg, scm, false);
if (err)
return err;
if (unix_passcred_enabled(socket, other)) {
scm->pid ... | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static bool unix_skb_scm_eq(struct sk_buff *skb, struct scm_cookie *scm) {
return UNIXCB(skb).pid == scm->pid &&
uid_eq(UNIXCB(skb).uid, scm->creds.uid) &&
gid_eq(UNIXCB(skb).gid, scm->creds.gid) && unix_secdata_eq(scm, skb);
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void scm_stat_del(struct sock *sk, struct sk_buff *skb) {
struct scm_fp_list *fp = UNIXCB(skb).fp;
struct unix_sock *u = unix_sk(sk);
if (unlikely(fp && fp->count))
atomic_sub(fp->count, &u->scm_stat.nr_fds);
} | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c |
int __unix_stream_recvmsg(struct sock *sk, struct msghdr *msg, size_t size,
int flags) {
struct unix_stream_read_state state = {.recv_actor = unix_stream_read_actor,
.socket = sk->sk_socket,
.msg = msg,
... | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c | static int unix_shutdown(struct socket *sock, int mode) {
struct sock *sk = sock->sk;
struct sock *other;
if (mode < SHUT_RD || mode > SHUT_RDWR)
return -EINVAL;
++mode;
unix_state_lock(sk);
sk->sk_shutdown |= mode;
other = unix_peer(sk);
if (other)
sock_hold(other);
unix_state_unlock(sk);
... | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c | static int unix_compat_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg) {
return unix_ioctl(sock, cmd, (unsigned long)compat_ptr(arg));
}
#endif | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static struct sock *unix_from_bucket(struct seq_file *seq, loff_t *pos) {
unsigned long offset = get_offset(*pos);
unsigned long bucket = get_bucket(*pos);
unsigned long count = 0;
struct sock *sk;
for (sk = sk_head(&seq_file_net(seq)->unx.table.buckets[bucket]); sk;
sk = sk_next(sk)) {
if (++cou... | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c |
static struct sock *unix_get_next(struct seq_file *seq, struct sock *sk,
loff_t *pos) {
unsigned long bucket = get_bucket(*pos);
sk = sk_next(sk);
if (sk)
return sk;
spin_unlock(&seq_file_net(seq)->unx.table.locks[bucket]);
*pos = set_bucket_offset(++bucket, 1);
re... | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c | static int unix_seq_show(struct seq_file *seq, void *v) {
if (v == SEQ_START_TOKEN)
seq_puts(seq, "Num RefCount Protocol Flags Type St "
"Inode Path\n");
else {
struct sock *s = v;
struct unix_sock *u = unix_sk(s);
unix_state_lock(s);
seq_printf(
seq, "%pK: %... | [
1,
0
] |
Linux Kernel | net/unix/af_unix.c | static int unix_prog_seq_show(struct bpf_prog *prog, struct bpf_iter_meta *meta,
struct unix_sock *unix_sk, uid_t uid) {
struct bpf_iter__unix ctx;
meta->seq_num--;
ctx.meta = meta;
ctx.unix_sk = unix_sk;
ctx.uid = uid;
return bpf_iter_run_prog(prog, &ctx);
} | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static int bpf_iter_unix_realloc_batch(struct bpf_unix_iter_state *iter,
unsigned int new_batch_sz) {
struct sock **new_batch;
new_batch =
kvmalloc(sizeof(*new_batch) * new_batch_sz, GFP_USER | __GFP_NOWARN);
if (!new_batch)
return -ENOMEM;
bpf_iter_unix_put_b... | [
0,
0
] |
Linux Kernel | net/unix/af_unix.c |
static void bpf_iter_fini_unix(void *priv_data) {
struct bpf_unix_iter_state *iter = priv_data;
bpf_iter_fini_seq_net(priv_data);
kvfree(iter->batch);
} | [
0,
0
] |
Linux Kernel | net/unix/diag.c | static int sk_diag_dump_name(struct sock *sk, struct sk_buff *nlskb) {
struct unix_address *addr = smp_load_acquire(&unix_sk(sk)->addr);
if (!addr)
return 0;
return nla_put(nlskb, UNIX_DIAG_NAME,
addr->len - offsetof(struct sockaddr_un, sun_path),
addr->name->sun_path);
} | [
0,
0
] |
Linux Kernel | net/unix/diag.c |
static int sk_diag_dump_vfs(struct sock *sk, struct sk_buff *nlskb) {
struct dentry *dentry = unix_sk(sk)->path.dentry;
if (dentry) {
struct unix_diag_vfs uv = {
.udiag_vfs_ino = d_backing_inode(dentry)->i_ino,
.udiag_vfs_dev = dentry->d_sb->s_dev,
};
return nla_put(nlskb, UNIX_DIAG_V... | [
1,
0
] |
Linux Kernel | net/unix/diag.c |
static int sk_diag_dump_peer(struct sock *sk, struct sk_buff *nlskb) {
struct sock *peer;
int ino;
peer = unix_peer_get(sk);
if (peer) {
unix_state_lock(peer);
ino = sock_i_ino(peer);
unix_state_unlock(peer);
sock_put(peer);
return nla_put_u32(nlskb, UNIX_DIAG_PEER, ino);
}
return 0;... | [
0,
0
] |
Linux Kernel | net/unix/diag.c |
static int sk_diag_dump_uid(struct sock *sk, struct sk_buff *nlskb,
struct user_namespace *user_ns) {
uid_t uid = from_kuid_munged(user_ns, sock_i_uid(sk));
return nla_put(nlskb, UNIX_DIAG_UID, sizeof(uid_t), &uid);
} | [
1,
0
] |
Linux Kernel | net/unix/diag.c |
static int sk_diag_dump(struct sock *sk, struct sk_buff *skb,
struct unix_diag_req *req,
struct user_namespace *user_ns, u32 portid, u32 seq,
u32 flags) {
int sk_ino;
unix_state_lock(sk);
sk_ino = sock_i_ino(sk);
unix_state_unlock(sk);
... | [
0,
0
] |
Linux Kernel | net/unix/scm.c | struct sock *unix_get_socket(struct file *filp) {
struct sock *u_sock = NULL;
struct inode *inode = file_inode(filp);
if (S_ISSOCK(inode->i_mode) && !(filp->f_mode & FMODE_PATH)) {
struct socket *sock = SOCKET_I(inode);
struct sock *s = sock->sk;
/* PF_UNIX ? */
if (s && sock->ops && sock->ops->... | [
1,
0
] |
Linux Kernel | net/unix/scm.c | void unix_notinflight(struct user_struct *user, struct file *fp) {
struct sock *s = unix_get_socket(fp);
spin_lock(&unix_gc_lock);
if (s) {
struct unix_sock *u = unix_sk(s);
BUG_ON(!atomic_long_read(&u->inflight));
BUG_ON(list_empty(&u->link));
if (atomic_long_dec_and_test(&u->inflight))
... | [
0,
0
] |
Linux Kernel | net/unix/scm.c | static inline bool too_many_unix_fds(struct task_struct *p) {
struct user_struct *user = current_user();
if (unlikely(user->unix_inflight > task_rlimit(p, RLIMIT_NOFILE)))
return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN);
return false;
} | [
0,
0
] |
Linux Kernel | net/unix/scm.c | int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb) {
int i;
if (too_many_unix_fds(current))
return -ETOOMANYREFS;
UNIXCB(skb).fp = scm_fp_dup(scm->fp);
if (!UNIXCB(skb).fp)
return -ENOMEM;
for (i = scm->fp->count - 1; i >= 0; i--)
unix_inflight(scm->fp->user, scm->fp->fp[i]);
re... | [
1,
0
] |
Linux Kernel | net/unix/scm.c |
void unix_detach_fds(struct scm_cookie *scm, struct sk_buff *skb) {
int i;
scm->fp = UNIXCB(skb).fp;
UNIXCB(skb).fp = NULL;
for (i = scm->fp->count - 1; i >= 0; i--)
unix_notinflight(scm->fp->user, scm->fp->fp[i]);
} | [
1,
0
] |
Linux Kernel | net/unix/scm.c | void unix_destruct_scm(struct sk_buff *skb) {
struct scm_cookie scm;
memset(&scm, 0, sizeof(scm));
scm.pid = UNIXCB(skb).pid;
if (UNIXCB(skb).fp)
unix_detach_fds(&scm, skb);
/* So fscking what? fput() had been SMP-safe since the last Summer */
scm_destroy(&scm);
sock_wfree(skb);
} | [
1,
0
] |
Linux Kernel | net/unix/sysctl_net_unix.c |
int __net_init unix_sysctl_register(struct net *net) {
struct ctl_table *table;
if (net_eq(net, &init_net)) {
table = unix_table;
} else {
table = kmemdup(unix_table, sizeof(unix_table), GFP_KERNEL);
if (!table)
goto err_alloc;
table[0].data = &net->unx.sysctl_max_dgram_qlen;
}
net->... | [
1,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
static void __vsock_insert_bound(struct list_head *list,
struct vsock_sock *vsk) {
sock_hold(&vsk->sk);
list_add(&vsk->bound_table, list);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
void vsock_insert_connected(struct vsock_sock *vsk) {
struct list_head *list =
vsock_connected_sockets(&vsk->remote_addr, &vsk->local_addr);
spin_lock_bh(&vsock_table_lock);
__vsock_insert_connected(list, vsk);
spin_unlock_bh(&vsock_table_lock);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
void vsock_remove_bound(struct vsock_sock *vsk) {
spin_lock_bh(&vsock_table_lock);
if (__vsock_in_bound_table(vsk))
__vsock_remove_bound(vsk);
spin_unlock_bh(&vsock_table_lock);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
void vsock_remove_connected(struct vsock_sock *vsk) {
spin_lock_bh(&vsock_table_lock);
if (__vsock_in_connected_table(vsk))
__vsock_remove_connected(vsk);
spin_unlock_bh(&vsock_table_lock);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr) {
struct sock *sk;
spin_lock_bh(&vsock_table_lock);
sk = __vsock_find_bound_socket(addr);
if (sk)
sock_hold(sk);
spin_unlock_bh(&vsock_table_lock);
return sk;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
void vsock_remove_sock(struct vsock_sock *vsk) {
vsock_remove_bound(vsk);
vsock_remove_connected(vsk);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
bool vsock_find_cid(unsigned int cid) {
if (transport_g2h && cid == transport_g2h->get_local_cid())
return true;
if (transport_h2g && cid == VMADDR_CID_HOST)
return true;
if (transport_local && cid == VMADDR_CID_LOCAL)
return true;
return false;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
static bool vsock_is_accept_queue_empty(struct sock *sk) {
struct vsock_sock *vsk = vsock_sk(sk);
return list_empty(&vsk->accept_queue);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c | static void vsock_pending_work(struct work_struct *work) {
struct sock *sk;
struct sock *listener;
struct vsock_sock *vsk;
bool cleanup;
vsk = container_of(work, struct vsock_sock, pending_work.work);
sk = sk_vsock(vsk);
listener = vsk->listener;
cleanup = true;
lock_sock(listener);
lock_sock_nest... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c | static int __vsock_bind_connectible(struct vsock_sock *vsk,
struct sockaddr_vm *addr) {
static u32 port;
struct sockaddr_vm new_addr;
if (!port)
port = get_random_u32_above(LAST_RESERVED_PORT);
vsock_addr_init(&new_addr, addr->svm_cid, addr->svm_port);
if (addr->svm_... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
s64 vsock_stream_has_data(struct vsock_sock *vsk) {
return vsk->transport->stream_has_data(vsk);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
static int vsock_bind(struct socket *sock, struct sockaddr *addr,
int addr_len) {
int err;
struct sock *sk;
struct sockaddr_vm *vm_addr;
sk = sock->sk;
if (vsock_addr_cast(addr, addr_len, &vm_addr) != 0)
return -EINVAL;
lock_sock(sk);
err = __vsock_bind(sk, vm_addr);
releas... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c | static int vsock_shutdown(struct socket *sock, int mode) {
int err;
struct sock *sk;
mode++;
if ((mode & ~SHUTDOWN_MASK) || !mode)
return -EINVAL;
/* If this is a connection oriented socket and it is not connected then
* bail out immediately. If it is a DGRAM socket then we must first
* kick the... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
static int vsock_transport_cancel_pkt(struct vsock_sock *vsk) {
const struct vsock_transport *transport = vsk->transport;
if (!transport || !transport->cancel_pkt)
return -EOPNOTSUPP;
return transport->cancel_pkt(vsk);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c | static int vsock_accept(struct socket *sock, struct socket *newsock, int flags,
bool kern) {
struct sock *listener;
int err;
struct sock *connected;
struct vsock_sock *vconnected;
long timeout;
DEFINE_WAIT(wait);
err = 0;
listener = sock->sk;
lock_sock(listener);
if (!sock... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
static int vsock_listen(struct socket *sock, int backlog) {
int err;
struct sock *sk;
struct vsock_sock *vsk;
sk = sock->sk;
lock_sock(sk);
if (!sock_type_connectible(sk->sk_type)) {
err = -EOPNOTSUPP;
goto out;
}
if (sock->state != SS_UNCONNECTED) {
err = -EINVAL;
goto out;
}
... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c | static int vsock_connectible_wait_data(
struct sock *sk, struct wait_queue_entry *wait, long timeout,
struct vsock_transport_recv_notify_data *recv_data, size_t target) {
const struct vsock_transport *transport;
struct vsock_sock *vsk;
s64 data;
int err;
vsk = vsock_sk(sk);
err = 0;
transport = v... | [
1,
1
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
static long vsock_dev_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg) {
return vsock_dev_do_ioctl(filp, cmd, (void __user *)arg);
}
#ifdef CONFIG_COMPAT | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c | static long vsock_dev_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg) {
return vsock_dev_do_ioctl(filp, cmd, compat_ptr(arg));
}
#endif | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c | static int __init vsock_init(void) {
int err = 0;
vsock_init_tables();
vsock_proto.owner = THIS_MODULE;
vsock_device.minor = MISC_DYNAMIC_MINOR;
err = misc_register(&vsock_device);
if (err) {
pr_err("Failed to register misc device\n");
goto err_reset_transport;
}
err = proto_register(&vsock_p... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock.c |
const struct vsock_transport *vsock_core_get_transport(struct vsock_sock *vsk) {
return vsk->transport;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/af_vsock_tap.c |
static void __vsock_deliver_tap(struct sk_buff *skb) {
int ret;
struct vsock_tap *tmp;
list_for_each_entry_rcu(tmp, &vsock_tap_all, list) {
ret = __vsock_deliver_tap_skb(skb, tmp->dev);
if (unlikely(ret))
break;
}
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/diag.c |
static int __init vsock_diag_init(void) {
return sock_diag_register(&vsock_diag_handler);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static unsigned int get_port_by_srv_id(const guid_t *svr_id) {
return *((unsigned int *)svr_id);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static void hvs_set_channel_pending_send_size(struct vmbus_channel *chan) {
set_channel_pending_send_size(chan, HVS_PKT_LEN(HVS_SEND_BUF_SIZE));
virt_mb();
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c | static size_t hvs_channel_writable_bytes(struct vmbus_channel *chan) {
u32 writeable = hv_get_bytes_to_write(&chan->outbound);
size_t ret;
if (writeable <= HVS_PKT_LEN(1) + HVS_PKT_LEN(0))
return 0;
ret = writeable - HVS_PKT_LEN(1) - HVS_PKT_LEN(0);
return round_down(ret, 8);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c | static void hvs_do_close_lock_held(struct vsock_sock *vsk,
bool cancel_timeout) {
struct sock *sk = sk_vsock(vsk);
sock_set_flag(sk, SOCK_DONE);
vsk->peer_shutdown = SHUTDOWN_MASK;
if (vsock_stream_has_data(vsk) <= 0)
sk->sk_state = TCP_CLOSING;
sk->sk_state_change(sk);... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static int hvs_connect(struct vsock_sock *vsk) {
union hvs_service_id vm, host;
struct hvsock *h = vsk->trans;
vm.srv_id = srv_id_template;
vm.svm_port = vsk->local_addr.svm_port;
h->vm_srv_id = vm.srv_id;
host.srv_id = srv_id_template;
host.svm_port = vsk->remote_addr.svm_port;
h->host_srv_id = host... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static int hvs_shutdown(struct vsock_sock *vsk, int mode) {
if (!(mode & SEND_SHUTDOWN))
return 0;
hvs_shutdown_lock_held(vsk->trans, mode);
return 0;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static void hvs_release(struct vsock_sock *vsk) {
bool remove_sock;
remove_sock = hvs_close_lock_held(vsk);
if (remove_sock)
vsock_remove_sock(vsk);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static int hvs_dgram_enqueue(struct vsock_sock *vsk, struct sockaddr_vm *remote,
struct msghdr *msg, size_t dgram_len) {
return -EOPNOTSUPP;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static bool hvs_dgram_allow(u32 cid, u32 port) { return false; } | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static int hvs_update_recv_data(struct hvsock *hvs) {
struct hvs_recv_buf *recv_buf;
u32 pkt_len, payload_len;
pkt_len = hv_pkt_len(hvs->recv_desc);
if (pkt_len < HVS_HEADER_LEN)
return -EIO;
recv_buf = (struct hvs_recv_buf *)(hvs->recv_desc + 1);
payload_len = recv_buf->hdr.data_size;
if (payloa... | [
1,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static s64 hvs_stream_has_space(struct vsock_sock *vsk) {
struct hvsock *hvs = vsk->trans;
return hvs_channel_writable_bytes(hvs->chan);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static u64 hvs_stream_rcvhiwat(struct vsock_sock *vsk) {
return HVS_MTU_SIZE + 1;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static int
hvs_notify_recv_pre_block(struct vsock_sock *vsk, size_t target,
struct vsock_transport_recv_notify_data *d) {
return 0;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static int
hvs_notify_recv_post_dequeue(struct vsock_sock *vsk, size_t target,
ssize_t copied, bool data_read,
struct vsock_transport_recv_notify_data *d) {
return 0;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c |
static int
hvs_notify_send_pre_enqueue(struct vsock_sock *vsk,
struct vsock_transport_send_notify_data *d) {
return 0;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/hyperv_transport.c | static int hvs_suspend(struct hv_device *hv_dev) { return 0; } | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport.c |
static int virtio_transport_send_pkt(struct virtio_vsock_pkt *pkt) {
struct virtio_vsock *vsock;
int len = pkt->len;
rcu_read_lock();
vsock = rcu_dereference(the_virtio_vsock);
if (!vsock) {
virtio_transport_free_pkt(pkt);
len = -ENODEV;
goto out_rcu;
}
if (le64_to_cpu(pkt->hdr.dst_cid) == ... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport.c |
static bool virtio_transport_seqpacket_allow(u32 remote_cid) {
struct virtio_vsock *vsock;
bool seqpacket_allow;
seqpacket_allow = false;
rcu_read_lock();
vsock = rcu_dereference(the_virtio_vsock);
if (vsock)
seqpacket_allow = vsock->seqpacket_allow;
rcu_read_unlock();
return seqpacket_allow;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport.c |
static int virtio_vsock_vqs_init(struct virtio_vsock *vsock) {
struct virtio_device *vdev = vsock->vdev;
static const char *const names[] = {
"rx",
"tx",
"event",
};
vq_callback_t *callbacks[] = {
virtio_vsock_rx_done,
virtio_vsock_tx_done,
virtio_vsock_event_done,
};
in... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport.c | static int virtio_vsock_probe(struct virtio_device *vdev) {
struct virtio_vsock *vsock = NULL;
int ret;
ret = mutex_lock_interruptible(&the_virtio_vsock_mutex);
if (ret)
return ret;
if (rcu_dereference_protected(the_virtio_vsock,
lockdep_is_held(&the_virtio_vsock_mutex)))... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport.c |
static void __exit virtio_vsock_exit(void) {
unregister_virtio_driver(&virtio_vsock_driver);
vsock_core_unregister(&virtio_transport.transport);
destroy_workqueue(virtio_vsock_workqueue);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c | static struct sk_buff *virtio_transport_build_skb(void *opaque) {
struct virtio_vsock_pkt *pkt = opaque;
struct af_vsockmon_hdr *hdr;
struct sk_buff *skb;
size_t payload_len;
void *payload_buf;
payload_len = le32_to_cpu(pkt->hdr.len);
payload_buf = pkt->buf + pkt->off;
skb = alloc_skb(sizeof(*hdr) + s... | [
1,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
void virtio_transport_deliver_tap_pkt(struct virtio_vsock_pkt *pkt) {
if (pkt->tap_delivered)
return;
vsock_deliver_tap(virtio_transport_build_skb, pkt);
pkt->tap_delivered = true;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
static bool virtio_transport_inc_rx_pkt(struct virtio_vsock_sock *vvs,
struct virtio_vsock_pkt *pkt) {
if (vvs->rx_bytes + pkt->len > vvs->buf_alloc)
return false;
vvs->rx_bytes += pkt->len;
return true;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
static void virtio_transport_dec_rx_pkt(struct virtio_vsock_sock *vvs,
struct virtio_vsock_pkt *pkt) {
vvs->rx_bytes -= pkt->len;
vvs->fwd_cnt += pkt->len;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 credit) {
u32 ret;
spin_lock_bh(&vvs->tx_lock);
ret = vvs->peer_buf_alloc - (vvs->tx_cnt - vvs->peer_fwd_cnt);
if (ret > credit)
ret = credit;
vvs->tx_cnt += ret;
spin_unlock_bh(&vvs->tx_lock);
return ret;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
static int virtio_transport_send_credit_update(struct vsock_sock *vsk) {
struct virtio_vsock_pkt_info info = {
.op = VIRTIO_VSOCK_OP_CREDIT_UPDATE,
.vsk = vsk,
};
return virtio_transport_send_pkt_info(vsk, &info);
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c | static int virtio_transport_seqpacket_do_dequeue(struct vsock_sock *vsk,
struct msghdr *msg,
int flags) {
struct virtio_vsock_sock *vvs = vsk->trans;
struct virtio_vsock_pkt *pkt;
int dequeued_len = 0;
size_t user_... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
ssize_t virtio_transport_stream_dequeue(struct vsock_sock *vsk,
struct msghdr *msg, size_t len,
int flags) {
if (flags & MSG_PEEK)
return virtio_transport_stream_do_peek(vsk, msg, len);
else
return virtio_transport_stream_do_de... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
int virtio_transport_seqpacket_enqueue(struct vsock_sock *vsk,
struct msghdr *msg, size_t len) {
struct virtio_vsock_sock *vvs = vsk->trans;
spin_lock_bh(&vvs->tx_lock);
if (len > vvs->peer_buf_alloc) {
spin_unlock_bh(&vvs->tx_lock);
return -EMSGSIZE;
}
spin_... | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
int virtio_transport_dgram_dequeue(struct vsock_sock *vsk, struct msghdr *msg,
size_t len, int flags) {
return -EOPNOTSUPP;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
u32 virtio_transport_seqpacket_has_data(struct vsock_sock *vsk) {
struct virtio_vsock_sock *vvs = vsk->trans;
u32 msg_count;
spin_lock_bh(&vvs->rx_lock);
msg_count = vvs->msg_count;
spin_unlock_bh(&vvs->rx_lock);
return msg_count;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
int virtio_transport_do_socket_init(struct vsock_sock *vsk,
struct vsock_sock *psk) {
struct virtio_vsock_sock *vvs;
vvs = kzalloc(sizeof(*vvs), GFP_KERNEL);
if (!vvs)
return -ENOMEM;
vsk->trans = vvs;
vvs->vsk = vsk;
if (psk && psk->trans) {
struct virtio_vsoc... | [
1,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
int virtio_transport_notify_send_post_enqueue(
struct vsock_sock *vsk, ssize_t written,
struct vsock_transport_send_notify_data *data) {
return 0;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
int virtio_transport_dgram_enqueue(struct vsock_sock *vsk,
struct sockaddr_vm *remote_addr,
struct msghdr *msg, size_t dgram_len) {
return -EOPNOTSUPP;
} | [
0,
0
] |
Linux Kernel | net/vmw_vsock/virtio_transport_common.c |
static void virtio_transport_wait_close(struct sock *sk, long timeout) {
if (timeout) {
DEFINE_WAIT_FUNC(wait, woken_wake_function);
add_wait_queue(sk_sleep(sk), &wait);
do {
if (sk_wait_event(sk, &timeout, sock_flag(sk, SOCK_DONE), &wait))
break;
} while (!signal_pending(current) && ... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.