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


_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to