linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
	Chris Mason <chris.mason@fusionio.com>,
	Steve French <sfrench@samba.org>, Mark Fasheh <mfasheh@suse.com>,
	Joel Becker <jlbec@evilplan.org>, Matthew Wilcox <matthew@wil.cx>,
	linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
	samba-technical@lists.samba.org, ocfs2-devel@oss.oracle.com
Subject: Re: [patch 05/10] vfs: pass data to alloc_inode super operation
Date: Tue, 30 Oct 2012 20:51:42 +0000	[thread overview]
Message-ID: <20121030205142.GB2616@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1351628084-29358-8-git-send-email-jmoyer@redhat.com>

On Tue, Oct 30, 2012 at 04:14:39PM -0400, Jeff Moyer wrote:
> This patch passes a data pointer along to the alloc_inode
> super_operations function.  The value will initially be used by
> bdev_alloc_inode to allocate the bdev_inode on the same numa
> node as the device to which it is tied.

Yecchhh...

> -static struct inode *bdev_alloc_inode(struct super_block *sb)
> +static struct inode *bdev_alloc_inode(struct super_block *sb, void *data)
>  {
> -	struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, GFP_KERNEL);
> +	struct bdev_inode *ei;
> +	int partno;
> +	int node;
> +
> +	if (data) {
> +		struct gendisk *disk;
> +		dev_t dev = *(dev_t *)data;
> +		disk = get_gendisk(dev, &partno);
> +		node = disk->node_id;
> +		put_disk(disk);

Oh, _lovely_.  Such a stunningly elegant idea.  And why not pass the
sodding node_id directly, if I may ask?

[reads further]
[finds completely undocumented reason for that]

Take that crap out and don't bring it back.  And consider this kludge NAKed
once and forever.  It's unspeakably ugly, even if it didn't break just about
every fs out there (you do realize that almost all of them have ->alloc_inode(),
don't you?  Use grep and see).

  reply	other threads:[~2012-10-30 20:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
2012-10-30 20:14 ` [patch 05/10] vfs: pass data to alloc_inode super operation Jeff Moyer
2012-10-30 20:51   ` Al Viro [this message]
2012-10-30 21:17     ` Al Viro
2012-10-31 13:22       ` Jeff Moyer

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=20121030205142.GB2616@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=chris.mason@fusionio.com \
    --cc=dhowells@redhat.com \
    --cc=jlbec@evilplan.org \
    --cc=jmoyer@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=mfasheh@suse.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.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).