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