Re: [PATCH 4/5] ext4: implement ext4_fiemap

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

 



Andreas Dilger wrote:
> On May 24, 2008  17:02 -0700, Mark Fasheh wrote:
>> +#define EXT4_FIEMAP_FLAG_INCOMPAT_UNSUPP (FIEMAP_FLAG_INCOMPAT &	\
>> +					  ~(FIEMAP_FLAG_LUN_OFFSET))
> 
> Per discussion with Eric, this needs to be changed:
> 
> #define EXT4_FIEMAP_FLAG_SUPP (FIEMAP_FLAG_NUM_EXTENTS | FIEMAP_FLAG_SYNC | \
> 			       FIEMAP_FLAG_HSM_READ | FIEMAP_FLAG_LUN_ORDER)
> 

Yep, I agree with this and the others, probably should have put "proof
of concept" in the original message; I knew it had warts but didn't want
to hold up Mark's RFE.

Thanks Andreas,

-Eric

>> +struct fiemap_internal {
>> +	struct fiemap		*fiemap_s;
>> +	struct fiemap_extent	fm_extent;
>> +	char			*cur_ext_ptr;
>> +	int			err;
>> +};
> 
> This is no longer used and can be removed (now uses fiemap_extent_info).
> 
>> +/*
>> + * Callback function called for each extent to gather FIEMAP information.
>> + */
>> +int ext4_ext_fiemap_cb(struct inode *inode, struct ext4_ext_path *path,
>> +		       struct ext4_ext_cache *newex, struct ext4_extent *ex,
>> +		       void *data)
>> +{
>> +	/* Just counting extents? */
>> +	if (fieinfo->fi_flags & FIEMAP_FLAG_NUM_EXTENTS) {
>> +		fieinfo->fi_extents_mapped++;
>> +		return EXT_CONTINUE;
>> +	}
> 
> This isn't needed anymore, fiemap_fill_next_extent() handles it.
> 
> 
>> +int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
>> +		__u64 start, __u64 len)
>> +{
>> +	/* fallback to generic here if not extents */
>> +#warning fix bitmap fallback
>> +	if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
>> +		return -EOPNOTSUPP;
> 
> 	if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
> 		return generic_block_fiemap(inode, fieinfo, start, len,
> 					    ext4_get_block);
> 
>> +#if 0
>> +	/* bail on unsupported flags for this fs */
>> +	if (fiemap_s->fm_flags & EXT4_FIEMAP_FLAG_INCOMPAT_UNSUPP)
>> +		return -EOPNOTSUPP;
>> +#endif
> 
> This should be reinstated now that we have come to a decision on the flags:
> 
> 	if (fieinfo->fi_flags & ~EXT4_FIEMAP_FLAG_SUPP) {
> 		fieinfo->fi_flags &= ~EXT4_FIEMAP_FLAG_SUPP;
> 		return -EBADF;
> 	}
> 
> 
> 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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux