From: "David S. Miller" <davem@redhat.com>
To: bcrl@redhat.com
Cc: netdev@oss.sgi.com
Subject: Re: [patch] abstract out socket lock.users access
Date: Mon, 07 Oct 2002 15:14:59 -0700 (PDT) [thread overview]
Message-ID: <20021007.151459.09774569.davem@redhat.com> (raw)
In-Reply-To: <20021007175551.B30693@redhat.com>
From: Benjamin LaHaise <bcrl@redhat.com>
Date: Mon, 7 Oct 2002 17:55:51 -0400
We define this:
+#define sock_is_locked(sk) (NULL != (sk)->lock.owner)
But call:
+ (int)is_sock_locked(sk));
+ if (!is_sock_locked(sk))
...
- if (sk->lock.users != 0) {
+ if (is_sock_locked(sk)) {
And it's not a lock, it is a user ownership indication.
I'd therefore prefer "sock_owned_by_user" or similar.
Next:
+#define async_lock_sock(iocb, __sk, list) \
+({ int ret = 0; \
+ spin_lock_bh(&((__sk)->lock.slock)); \
+ if ((__sk)->lock.owner != NULL) \
+ ret = __async_lock_sock((iocb), (__sk), (list)); \
+ else \
+ (__sk)->lock.owner = (iocb); \
+ spin_unlock_bh(&((__sk)->lock.slock)); \
+ ret; \
+})
+
How does this work? Is there some protocol that treats (void *)1
specially inside of __async_lock_sock()? Where are this semantics
defined?
Please clean up the {is_sock,sock_is}_locked() stuff and define
how async_lock_sock works wrt. the owner pointer.
next prev parent reply other threads:[~2002-10-07 22:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-07 21:55 [patch] abstract out socket lock.users access Benjamin LaHaise
2002-10-07 22:14 ` David S. Miller [this message]
2002-10-07 22:50 ` Benjamin LaHaise
2002-10-07 22:53 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021007.151459.09774569.davem@redhat.com \
--to=davem@redhat.com \
--cc=bcrl@redhat.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).