On Jun 26, 2008 10:36 +0100, Jamie Lokier wrote: > Mark Fasheh wrote: > > * FIEMAP_FLAG_SYNC > > If this flag is set, the kernel will sync the file before mapping extents. > > Is there a reason why fsync() before calling FIEMAP is unsuitable? This was added because the xfsbmap operation always did an fsync before returning the extents. I don't think it is strictly required, but it isn't harmful either. > > * FIEMAP_FLAG_XATTR > > If this flag is set, the extents returned will describe the inodes > > extended attribute lookup tree, instead of it's data tree. > > What is this for? The meaning of the xattr tree sounds rather > filesystem specific to me. This is to return the location of the xattr blocks for the inode. > > * FIEMAP_EXTENT_NO_DIRECT > > Direct access to the data in this extent is illegal or will have > > undefined results. > ... > > * FIEMAP_EXTENT_NET > > - This will also set FIEMAP_EXTENT_NO_DIRECT > > The data for this extent is not stored in a locally-accessible device. > > Does this _always_ set FIEMAP_EXTENT_NO_DIRECT? Some network > filesystems do support O_DIRECT access - NFS comes to mind. > > (I'm assuming 'direct access' means O_DIRECT). "NO_DIRECT" has nothing to do with "O_DIRECT". It just means that, per the description a few lines earlier, direct access to the file data is impossible (i.e. for lilo or other tool which thinks it can open "dev" and seek to "fe_physical" to read the data), or at best will have undefined results (e.g. you may get encrypted or compressed data back, or it is on the far side of a network interface). > > * FIEMAP_EXTENT_DATA_ENCRYPTED > > - This will also set FIEMAP_EXTENT_NO_DIRECT > > The data in this extent has been encrypted by the file system. > > I don't think encryption necessarily rules out O_DIRECT. It'll depend > how I/O is implemented by that filesystem. > > > * FIEMAP_EXTENT_DATA_INLINE > > This will also set FIEMAP_EXTENT_NOT_ALIGNED > > Data is located within a meta data block. > > This seems like it would always set FIEMAP_EXTENT_NO_DIRECT :-) > > (Generally, won't FIEMAP_EXTENT_NOT_ALIGNED always set > FIEMAP_EXTENT_NO_DIRECT?) > > > * FIEMAP_EXTENT_DATA_TAIL > > This will also set FIEMAP_EXTENT_NOT_ALIGNED > > Data is packed into a block with data from other files. > > Maybe this too. The rest of these comments seem based on the previous misunderstanding. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html