Re: [PATCH] Add extent conversion support to chattr

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

 



On Tue, Sep 09, 2008 at 09:58:14PM +0530, Aneesh Kumar K.V wrote:
> diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c
> index 62189c9..d1bb9d9 100644
> --- a/lib/e2p/fsetflags.c
> +++ b/lib/e2p/fsetflags.c
> @@ -80,9 +80,19 @@ int fsetflags (const char * name, unsigned long flags)
>  	if (fd == -1)
>  		return -1;
>  	f = (int) flags;
> +	if (f & EXT4_EXTENTS_FL) {
> +		/* extent flags is set using  migrate ioctl */
> +		r = ioctl (fd, EXT4_IOC_MIGRATE, NULL);
> +		if (r == -1) {
> +			save_errno = errno;
> +			goto err_out;
> +		}
> +		f = (int)flags & ~EXT4_EXTENTS_FL;
> +	}

No, I wouldn't put this in libe2p; it probably should be in the chattr
program.  If you do it in chattr, it's much easier to have an
user-friendly error message if the EXT4_IOC_MIGRATE ioctl fails.

Also, it should only call EXT4_IOC_MIGRATE if the file was previously
not supporting extents.  Probably a bad idea to unconditionally call
EXT4_IOC_MIGRATE.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux