public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: viro@parcelfarce.linux.theplanet.co.uk
Cc: Wim Van Sebroeck <wim@iguana.be>, linux-kernel@vger.kernel.org
Subject: Re: watchdog infrastructure
Date: Mon, 12 Jul 2004 14:20:45 +0200	[thread overview]
Message-ID: <200407121420.50190.arnd@arndb.de> (raw)
In-Reply-To: <20040712082313.GW12308@parcelfarce.linux.theplanet.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

On Montag, 12. Juli 2004 10:23, viro@parcelfarce.linux.theplanet.co.uk wrote:
> On Mon, Jul 12, 2004 at 10:19:39AM +0200, Wim Van Sebroeck wrote:
> > > - You need to get the module reference count before calling any
> > >   watchdog operation, the best place for this is probably the
> > >   open() fop.
> 
> Huh?  Just set ->owner in file_operations and be done with that.
> 
Yes, that would work. However, I don't feel comfortable with setting
fops->owner to anything else than THIS_MODULE. In particular, this
causes problems when multiple watchdog drivers register with the
watchdog base module.

The sequence I had in mind was:

chrdev_open()
   try_module_get(fops->owner)
   watchdog_open()
      try_module_get(wdops->owner)
      wdops->start()


vfs_write
   watchdog_write()
      wdops->keepalive()

...

fput()
   watchdog_release()
       wdops->stop()
       module_put(wdops->owner)
   module_put(fops->owner)

This would practically do the same for the watchdog layer that we already
do for inside vfs for the file_operations.

	Arnd <><

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-07-12 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-01 17:23 watchdog infrastructure Arnd Bergmann
2004-07-05  9:38 ` Wim Van Sebroeck
2004-07-05 12:54   ` Arnd Bergmann
2004-07-12  8:19     ` Wim Van Sebroeck
2004-07-12  8:23       ` viro
2004-07-12 12:20         ` Arnd Bergmann [this message]
2004-07-12 13:04       ` Arnd Bergmann

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=200407121420.50190.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=wim@iguana.be \
    /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