From: Christoph Hellwig <hch@infradead.org>
To: Alan Cox <alan@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PATCH: tty ldisc locking/ordering
Date: Fri, 10 Sep 2004 16:55:20 +0100 [thread overview]
Message-ID: <20040910165520.A25852@infradead.org> (raw)
In-Reply-To: <20040910153810.GA7431@devserv.devel.redhat.com>; from alan@redhat.com on Fri, Sep 10, 2004 at 11:38:10AM -0400
On Fri, Sep 10, 2004 at 11:38:10AM -0400, Alan Cox wrote:
> +In order to remove a line discipline call tty_register_ldisc passing NULL.
> +In ancient times this always worked. In modern times the function will
> +return -EBUSY if the ldisc is currently in use. Since the ldisc referencing
> +code manages the module counts this should not usually be a concern.
So what is a module supposed to do if this fails? It's usually called from
module_exit so there's no way to recover.
> +Three calls are now provided
> +
> + ldisc = tty_ldisc_ref(tty);
> +
> +takes a handle to the line discipline in the tty and returns it. If no ldisc
> +is currently attached or the ldisc is being closed and re-opened at this
> +point then NULL is returned. While this handle is held the ldisc will not
> +change or go away.
> +
> + tty_ldisc_deref(ldisc)
We tend to call these _get/_put just about everywhere else in the kernel,
maybe some consisteny is a good idea?
next prev parent reply other threads:[~2004-09-10 15:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-10 15:38 PATCH: tty ldisc locking/ordering Alan Cox
2004-09-10 15:55 ` Christoph Hellwig [this message]
2004-09-10 16:01 ` Alan Cox
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=20040910165520.A25852@infradead.org \
--to=hch@infradead.org \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.