Manoj Nayak
2007-Oct-12 12:21 UTC
[zfs-discuss] XFS_IOC_FSGETXATTR & XFS_IOC_RESVSP64 like options in ZFS ?
Hi, I am using XFS_IOC_FSGETXATTR in ioctl() call on Linux running XFS file system.I want to use similar thing on Solaris running ZFS file system. struct fsxattr fsx; ioctl(fd, XFS_IOC_FSGETXATTR, &fsx); The above call get additional attributes associated with files in XFS file systems. The final argument points to a variable of type struct fsxattr, whose fields include: fsx_xflags (extended flag bits), fsx_extsize (nominal extent size in file system blocks), fsx_nextents (number of data extents in the file). A fsx_extsize value returned indicates that a preferred extent size was previously set on the file, a fsx_extsize of zero indicates that the defaults for that filesystem will be used. Structure for XFS_IOC_FSGETXATTR and XFS_IOC_FSSETXATTR. struct fsxattr { __u32 fsx_xflags; /* xflags field value (get/set) */ __u32 fsx_extsize; /* extsize field value (get/set)*/ __u32 fsx_nextents; /* nextents field value (get) */ __u32 fsx_projid; /* project identifier (get/set) */ unsigned char fsx_pad[12]; }; Is it possible to use ioctl to allocate disk space on ZFS ? I am using XFS_IOC_RESVSP64 in ioctl() call on Linux running XFS file system. flock.l_whence = SEEK_SET; flock.l_start = file_size; flock.l_len = n_bytes_grow; ioctl_ret = ioctl(fd, XFS_IOC_RESVSP64, &flock); The above call is used to allocate space to a file. A range of bytes is specified using a pointer to a variable of type xfs_flock64_t in the final argument. The blocks are allocated, but not zeroed, and the file size does not change. If the XFS filesystem is configured to flag unwritten file extents, performance will be negatively affected when writing to preallocated space, since extra filesystem transactions are required to convert extent flags on the range of the file written. Thanks Manoj Nayak
Darren J Moffat
2007-Oct-12 14:28 UTC
[zfs-discuss] XFS_IOC_FSGETXATTR & XFS_IOC_RESVSP64 like options in ZFS ?
Manoj Nayak wrote:> Hi, > > I am using XFS_IOC_FSGETXATTR in ioctl() call on Linux running XFS file > system.I want to use similar thing on Solaris running ZFS file system.See openat(2). -- Darren J Moffat
Anton B. Rang
2007-Oct-13 06:36 UTC
[zfs-discuss] XFS_IOC_FSGETXATTR & XFS_IOC_RESVSP64 like
openat() isn''t really what he wants. These aren''t user-level xattrs, they''re ones which affect the file system, or more specifically, a particular file. I don''t think the particular xattrs in question (or analogous ones) exist for ZFS at this point. This message posted from opensolaris.org