[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preallocation and Ferris




Hi,
  After looking at the xfs_bmap code a little and working out my
next move I noticed in xfs_fs.h

struct getbmapx {
	__s64		bmv_offset;	/* file offset of segment in blocks */
	__s64		bmv_block;	/* starting block (64-bit daddr_t)  */
	__s64		bmv_length;	/* length of segment, blocks	    */
	__s32		bmv_count;	/* # of entries in array incl. 1st  */
	__s32		bmv_entries;	/* # of entries filled in (output). */
	__s32		bmv_iflags;	/* input flags (1st structure)	    */
	__s32		bmv_oflags;	/* output flags (after 1st structure)*/
	__s32		bmv_unused1;	/* future use			    */
	__s32		bmv_unused2;	/* future use			    */
};

/*	bmv_iflags values - set by XFS_IOC_GETBMAPX caller.	*/
#define	BMV_IF_ATTRFORK		0x1	/* return attr fork rather than data */
#define BMV_IF_NO_DMAPI_READ	0x2	/* Do not generate DMAPI read event  */
#define BMV_IF_PREALLOC		0x4	/* rtn status BMV_OF_PREALLOC if req */
#define BMV_IF_VALID	(BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC)
#ifdef __KERNEL__
#define	BMV_IF_EXTENDED	0x40000000	/* getpmapx if set */
#endif

/*	bmv_oflags values - returned for for each non-header segment */
#define BMV_OF_PREALLOC		0x1	/* segment = unwritten pre-allocation */


I have tried using BMV_IF_PREALLOC and just dumping out 
map[i+1].bmv_oflags
for each extent listed though its *always* 0. This is 
using the official 1.0.2 (IIRC) 2.4.14 kernel stuff and
xfsprogs-1.3.17-0.

I suspect that maybe the prealloc stuff is not being sent to 
userland and I can not work out how to get xfs_bmap to
show me a flag for an extent that is preallocation.

BTW I now have preallocation switch working for file creation
in ferris :) it shows a 0 byte file with an extent that is 
the preallocation size rounded up to next block.

How "experimental" is the real time file support? I am wondering
if there are other sweet xfs features that I should make available
in ferris :) The interface to make preallocated files uses the
ferriscreate GUI, http://witme.sourceforge.net/ferriscreate.paper2001/
I will make new screenshots of that soon using preallocation and 
anything else I throw in there for my xfs and other enjoyment.

Though I would like to expose the final preallocation extent as 
fake EA in ferris to allow a easy interface to expand/reduce 
preallocation from a cute GUI ;)

BTW what is the mood on acceptance of a patch for xfs_bmap to have
an --xml option to dump the same info from -v as an XML 1.0 document?
this would make it nice and easy to make an extent viewer as either
a gtk+ app or a php4 app.

-- 
-----------------------------------------------------
http://witme.sourceforge.net/libferris.web/