Re: [PATCH 2/5] ocfs2: fiemap support

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

 



On May 24, 2008  17:02 -0700, Mark Fasheh wrote:
> +int ocfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
> +		 u64 map_start, u64 map_len)
> +{
> +	int ret, is_last;
> +	u32 mapping_end, cpos;
> +	unsigned int hole_size;
> +	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
> +	u64 len_bytes, phys_bytes, virt_bytes;
> +	struct buffer_head *di_bh = NULL;
> +	struct ocfs2_extent_rec rec;
> +
> +	if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR) {
> +		fieinfo->fi_flags = FIEMAP_FLAG_XATTR;
> +		return -EBADR;
> +	}

This actually needs to check for every flag it DOES understand, otherwise
it would break as soon as a new flag is added, per my comment in the VFS
patch email.

#define OCFS2_FIEMAP_FLAG_SUPP (FIEMAP_FLAG_NUM_EXTENTS | FIEMAP_FLAG_SYNC |\
				FIEMAP_FLAG_HSM_READ | FIEMAP_FLAG_LUN_ORDER)


	if (fieinfo->fi_flags & ~OCFS2_FIEMAP_FLAG_SUPP) {
		fieinfo->fi_flags &= ~OCFS_FIEMAP_FLAG_SUPP;
		return -EBADR;
	}

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