• Home
  • Raw
  • Download

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 (!u->inflight) { 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()
62 u->inflight++; in unix_inflight()
66 WRITE_ONCE(user->unix_inflight, user->unix_inflight + 1); in unix_inflight()
79 BUG_ON(!u->inflight); in unix_notinflight()
80 BUG_ON(list_empty(&u->link)); in unix_notinflight()
82 u->inflight--; in unix_notinflight()
83 if (!u->inflight) in unix_notinflight()
84 list_del_init(&u->link); in unix_notinflight()
86 WRITE_ONCE(unix_tot_inflight, unix_tot_inflight - 1); in unix_notinflight()
88 WRITE_ONCE(user->unix_inflight, user->unix_inflight - 1); in unix_notinflight()
93 * The "user->unix_inflight" variable is protected by the garbage
102 if (unlikely(READ_ONCE(user->unix_inflight) > task_rlimit(p, RLIMIT_NOFILE))) in too_many_unix_fds()
103 return !capable(CAP_SYS_RESOURCE) && !capable(CAP_SYS_ADMIN); in too_many_unix_fds()
112 return -ETOOMANYREFS; in unix_attach_fds()
119 UNIXCB(skb).fp = scm_fp_dup(scm->fp); in unix_attach_fds()
121 return -ENOMEM; in unix_attach_fds()
123 for (i = scm->fp->count - 1; i >= 0; i--) in unix_attach_fds()
124 unix_inflight(scm->fp->user, scm->fp->fp[i]); in unix_attach_fds()
133 scm->fp = UNIXCB(skb).fp; in unix_detach_fds()
136 for (i = scm->fp->count-1; i >= 0; i--) in unix_detach_fds()
137 unix_notinflight(scm->fp->user, scm->fp->fp[i]); in unix_detach_fds()
151 /* So fscking what? fput() had been SMP-safe since the last Summer */ in unix_destruct_scm()