aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/af_unix.h
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2020-02-28 14:45:21 +0100
committerDavid S. Miller <davem@davemloft.net>2020-02-28 12:12:53 -0800
commit7782040b950b5d0433f734fb2bba8b8b5ed6ce5a (patch)
tree70d2549b3467bf6ec5b3e96d7d679e111d1b984c /include/net/af_unix.h
parentaf_unix: Replace zero-length array with flexible-array member (diff)
downloadlinux-dev-7782040b950b5d0433f734fb2bba8b8b5ed6ce5a.tar.xz
linux-dev-7782040b950b5d0433f734fb2bba8b8b5ed6ce5a.zip
unix: uses an atomic type for scm files accounting
So the scm_stat_{add,del} helper can be invoked with no additional lock held. This clean-up the code a bit and will make the next patch easier. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/af_unix.h')
-rw-r--r--include/net/af_unix.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index e51d727cc3cd..f42fdddecd41 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -42,7 +42,7 @@ struct unix_skb_parms {
} __randomize_layout;
struct scm_stat {
- u32 nr_fds;
+ atomic_t nr_fds;
};
#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))