mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Alexander Viro <viro@math.psu.edu>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] struct char_device
Date: Tue, 22 May 2001 16:26:45 +0100	[thread overview]
Message-ID: <5.1.0.14.2.20010522153915.00ac1630@pop.cus.cam.ac.uk> (raw)
In-Reply-To: <Pine.GSO.4.21.0105221007460.15685-100000@weyl.math.psu.edu >

Hello,

At 15:18 22/05/01, Alexander Viro wrote:
[snip cool stuff]
>diff -urN S5-pre4/include/linux/fs.h S5-pre4-cdev/include/linux/fs.h
>--- S5-pre4/include/linux/fs.h  Sat May 19 22:46:36 2001
>+++ S5-pre4-cdev/include/linux/fs.h     Tue May 22 09:14:25 2001
>@@ -384,6 +384,14 @@
>         int                     gfp_mask;       /* how to allocate the 
> pages */
>  };
>
>+struct char_device {
>+       struct list_head        hash;
>+       atomic_t                count;
>+       dev_t                   dev;
>+       atomic_t                openers;
>+       struct semaphore        sem;

Why not name consistently with the struct block_device?
I.e.:
struct char_device {
         struct list_head        cd_hash;
         atomic_t                cd_count;
         dev_t                   cd_dev;
         atomic_t                cd_openers;
         struct semaphore        cd_sem;
};

>@@ -426,8 +434,10 @@
>         struct address_space    *i_mapping;
>         struct address_space    i_data;
>         struct dquot            *i_dquot[MAXQUOTAS];
>+       /* These three should probably be a union */
>         struct pipe_inode_info  *i_pipe;
>         struct block_device     *i_bdev;
>+       struct char_device      *i_cdev;

You could then use an (perhaps even unnamed if we require a high enough gcc 
version) union in the inode structure so you don't waste space having a 
pointer to both c_dev and b_dev, such as:

         union {
                 struct block_device     *i_bdev;
                 struct char_device      *i_cdev;
         };

It isn't possible that both i_bdev and i_cdev are used at the same time, is 
it? If it was my suggestion is obviously bogus...

Any reasons why my proposal would be a bad idea?

Just IMVHO.

Best regards,

Anton


-- 
   "Nothing succeeds like success." - Alexandre Dumas
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://sf.net/projects/linux-ntfs/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/


       reply	other threads:[~2001-05-22 15:27 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.GSO.4.21.0105221007460.15685-100000@weyl.math.psu.edu >
2001-05-22 15:26 ` Anton Altaparmakov [this message]
2001-05-22 16:08   ` Oliver Xymoron
2001-05-22 16:12     ` Alexander Viro
2001-05-22 17:30       ` Oliver Xymoron
2001-05-22 17:41         ` Alexander Viro
2001-05-22 19:22     ` Guest section DW
2001-05-22 19:25       ` Alexander Viro
2001-05-22 19:38       ` Oliver Xymoron
2001-05-23 20:01 Andries.Brouwer
  -- strict thread matches above, loose matches on Subject: below --
2001-05-23 18:28 Andries.Brouwer
2001-05-23 18:42 ` Alexander Viro
2001-05-23 15:24 Wayne.Brown
2001-05-23 13:34 Andries.Brouwer
2001-05-23 17:54 ` Alexander Viro
2001-05-24 10:35   ` Stephen C. Tweedie
2001-05-23 12:29 Andries.Brouwer
2001-05-23 12:30 ` Alan Cox
2001-05-23 13:26 ` Helge Hafting
2001-05-23 11:57 Andries.Brouwer
2001-05-23 12:13 ` Alan Cox
2001-05-23  6:47 Andries.Brouwer
2001-05-23  0:28 Andries.Brouwer
2001-05-23  0:38 ` Alexander Viro
2001-05-23  0:22 Andries.Brouwer
2001-05-23  0:29 ` Martin Dalecki
2001-05-23  0:20 Andries.Brouwer
2001-05-23  2:43 ` Linus Torvalds
2001-05-23  0:01 Andries.Brouwer
2001-05-22 23:33 Andries.Brouwer
2001-05-23  0:03 ` Alexander Viro
2001-05-22 22:17 Andries.Brouwer
2001-05-22 22:34 ` Martin Dalecki
2001-05-22 22:47 ` Martin Dalecki
2001-05-23  0:02   ` Jeff Garzik
2001-05-23  0:14     ` Jens Axboe
2001-05-23  2:40     ` Linus Torvalds
2001-05-23 12:35       ` Martin Dalecki
2001-05-22 21:35 Andries.Brouwer
2001-05-22 22:00 ` Martin Dalecki
2001-05-22 20:54 Andries.Brouwer
2001-05-22 21:17 ` Martin Dalecki
2001-05-22 22:37 ` Linus Torvalds
2001-05-22 23:51   ` Alexander Viro
2001-05-23  0:06     ` Jeff Garzik
2001-05-23  0:14       ` Jens Axboe
2001-05-23  2:37       ` Linus Torvalds
2001-05-23  3:04         ` Jeff Garzik
2001-05-23  3:21           ` Jeff Garzik
2001-05-23  9:05         ` Alan Cox
2001-05-23  2:35     ` Linus Torvalds
2001-05-22 19:52 Andries.Brouwer
2001-05-22 20:10 ` Alexander Viro
     [not found] <Pine.LNX.4.10.10105221050080.8984-100000@coffee.psychology.mcmaster.ca>
2001-05-22 14:59 ` Tommy Hallgren
2001-05-22 14:40 Tommy Hallgren
2001-05-22 14:18 Alexander Viro

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=5.1.0.14.2.20010522153915.00ac1630@pop.cus.cam.ac.uk \
    --to=aia21@cam.ac.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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

all inboxes | Powered by JetHome®