linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Josef Bacik <jbacik@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org
Subject: Re: [RFC][PATCH] expose get_block via inode_operations
Date: Wed, 23 Apr 2008 08:59:38 +0100	[thread overview]
Message-ID: <20080423075938.GY27459@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20080422181824.GA2852@unused.rdu.redhat.com>

On Tue, Apr 22, 2008 at 02:18:24PM -0400, Josef Bacik wrote:
> Hello,
> 
> In order to add a generic FIEMAP support for all filesystems that do not
> necessarily have extents (ie ext2/3), it is necessary to have direct access to
> the filesystems get_block function.  The reason for this is because in certain
> cases (again ext2/3) the filesystem has the ability to map as many contiguous
> blocks together at once, which would be far more efficient than calling ->bmap()
> over and over for all of the blocks in the inode.  In order to accomplish this I
> would like to expose the filesystems get_block function via an inode operation.
> This would allow me to create a simple generic FIEMAP function that could be
> used on all fs's and be a bit more efficient that FIBMAP, and it would clean up
> where we are passing get_block_t everywhere.

ITYM "bugger up".  Strong NAK; do not breed methods that do not even make
sense for a lot of class instances.

This, BTW, is a general principle - the same reason why ->read_inode() is
gone, for example.

If you have a function that needs fs-dependent callback and can be safely
called only by specific fs (== relies on fs properties), by all means,
make it a library helper and have your fs call it.  Passing whatever
callbacks it wants explicitly.  With fs being responsible for choosing
to use that library helper.

get_block semantics can't be even defined for generic filesystem; it's not
that "this fs or this file doesn't do that operation", it's "operation can't
be defined in terms that make sense for all filesystems".

      parent reply	other threads:[~2008-04-23  7:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22 18:18 [RFC][PATCH] expose get_block via inode_operations Josef Bacik
2008-04-23  7:35 ` Christoph Hellwig
2008-04-23 13:05   ` Josef Bacik
2008-04-23  7:59 ` Al Viro [this message]

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=20080423075938.GY27459@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hch@infradead.org \
    --cc=jbacik@redhat.com \
    --cc=linux-fsdevel@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 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).