Lines Matching +full:smp +full:- +full:capable

1 // SPDX-License-Identifier: GPL-2.0
30 if (S_ISSOCK(inode->i_mode) && !(filp->f_mode & FMODE_PATH)) { in unix_get_socket()
32 const struct proto_ops *ops = READ_ONCE(sock->ops); in unix_get_socket()
33 struct sock *s = sock->sk; in unix_get_socket()
36 if (s && ops && ops->family == PF_UNIX) in unix_get_socket()
56 if (atomic_long_inc_return(&u->inflight) == 1) { in unix_inflight()
57 BUG_ON(!list_empty(&u->link)); in unix_inflight()
58 list_add_tail(&u->link, &gc_inflight_list); in unix_inflight()
60 BUG_ON(list_empty(&u->link)); in unix_inflight()
65 WRITE_ONCE(user->unix_inflight, user->unix_inflight + 1); in unix_inflight()
78 BUG_ON(!atomic_long_read(&u->inflight)); in unix_notinflight()
79 BUG_ON(list_empty(&u->link)); in unix_notinflight()
81 if (atomic_long_dec_and_test(&u->inflight)) in unix_notinflight()
82 list_del_init(&u->link); in unix_notinflight()
84 WRITE_ONCE(unix_tot_inflight, unix_tot_inflight - 1); in unix_notinflight()
86 WRITE_ONCE(user->unix_inflight, user->unix_inflight - 1); in unix_notinflight()
91 * The "user->unix_inflight" variable is protected by the garbage
100 if (unlikely(READ_ONCE(user->unix_inflight) > task_rlimit(p, RLIMIT_NOFILE))) in too_many_unix_fds()
101 return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN); in too_many_unix_fds()
110 return -ETOOMANYREFS; in unix_attach_fds()
117 UNIXCB(skb).fp = scm_fp_dup(scm->fp); in unix_attach_fds()
119 return -ENOMEM; in unix_attach_fds()
121 for (i = scm->fp->count - 1; i >= 0; i--) in unix_attach_fds()
122 unix_inflight(scm->fp->user, scm->fp->fp[i]); in unix_attach_fds()
131 scm->fp = UNIXCB(skb).fp; in unix_detach_fds()
134 for (i = scm->fp->count-1; i >= 0; i--) in unix_detach_fds()
135 unix_notinflight(scm->fp->user, scm->fp->fp[i]); in unix_detach_fds()
149 /* So fscking what? fput() had been SMP-safe since the last Summer */ in unix_destruct_scm()