Re: [PATCH 2/2] FIEMAP ioctl for ext4

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Kalpak Shah <Kalpak.Shah@...>
Cc: linux-ext4 <linux-ext4@...>, linux-fsdevel <linux-fsdevel@...>, Andreas Dilger <adilger@...>, Eric Sandeen <sandeen@...>, <mark.fasheh@...>, <dgc@...>
Date: Monday, November 12, 2007 - 11:54 pm

On Tue, Nov 13, 2007 at 02:30:06AM +0530, Kalpak Shah wrote:
....

Please make this common - we dont want a new ioctl for every
filesystem; we want a single common to all filesystems.


Most of this function will be common to all IOC_FIEMAP
implementations.


	struct address_space *mapping = filp->f_mapping;

	if (!mapping->a_ops->fiemap)
		return -EOPNOTSUPP;


This is common


The common form is:

	if (fiemap_s->fm_flags & FIEMAP_FLAG_SYNC)
		filemap_write_and_wait(mapping);


Seems common.


This becomes:

	error = mapping->a_ops->fiemap(inode, ....);

and the lock, extent walk, etc becomes ext4_fiemap() which is set up
in the a_ops for the filesystem. Any filesystems specific checks go
there as well.


That's common, too.

I don't want to see this implemented over and over again with minute
variations and bugs. The common implementation should be called from
in do_file_ioctl() like FIBMAP....

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/2] FIEMAP ioctl for ext4, Kalpak Shah, (Mon Nov 12, 5:00 pm)
Re: [PATCH 2/2] FIEMAP ioctl for ext4, David Chinner, (Mon Nov 12, 11:54 pm)