kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: vikram186@gmail.com (Vikram Narayanan)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Confusion in kobjects
Date: Wed, 4 May 2011 19:26:44 +0530	[thread overview]
Message-ID: <BANLkTina-q5sGJ4hOOHBbjKdqHqLSEGM+w@mail.gmail.com> (raw)

The kernel doc (kobject.txt) says that

"No structure should EVER have more than one kobject embedded within it.
 If it does, the reference counting for the object is sure to be messed
 up and incorrect, and your code will be buggy.  So do not do this. "

But in the file drivers/uio/uio.c, a structure has two such kobjects.

struct uio_device {
         struct module           *owner;
         struct device           *dev;
         int                     minor;
         atomic_t                event;
         struct fasync_struct    *async_queue;
         wait_queue_head_t       wait;
         int                     vma_count;
         struct uio_info         *info;
         struct kobject          *map_dir;
         struct kobject          *portio_dir;
 };

So, What is the exception for this structure? Is this right? If yes,
can someone explain why it is right, and where should we use it?

Thanks,
Vikram

             reply	other threads:[~2011-05-04 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 13:56 Vikram Narayanan [this message]
2011-05-04 14:59 ` Confusion in kobjects Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2011-05-04 16:26 Vikram Narayanan

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=BANLkTina-q5sGJ4hOOHBbjKdqHqLSEGM+w@mail.gmail.com \
    --to=vikram186@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 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).