[XFS] How to use real-time subvolume

Hi!

I created filesystem XFS on partition hda8 with subvolume real-time on partition hda5:

mkfs.xfs -r rtdev=/dev/hda5 /dev/hda8

and i mounted it:

mount -t xfs -o rtdev=/dev/hda5 /dev/hda8 /xfs

But I don't know how can I use this partition hda5 with subvolume real-time. I don't know how to create directories, copy files to it and another. Thanks for all answers!

From man 5 xfs:

       The realtime section is used to  store  the  data  of  realtime  files.
       These  files had an attribute bit set through xfsctl(3) after file cre-
       ation, before any data was written to the file.  The  realtime  section
       is  divided  into  a  number  of  extents  of  fixed size (specified at
       mkfs.xfs(8) time).  Each file in the realtime  section  has  an  extent
       size that is a multiple of the realtime section extent size.

xfsctl is a C function call.

I don't understand, how can I use it. Can you give me an example, please?

I don't know any utility program that does this, it's just a generic C function for editing XFS extended attributes. Here's an example C program that calls it:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include <xfs/xfs.h>

#define DIE(X)  do { perror(X); goto EXIT_FAIL; } while(0)

int main(void)
{
        struct fsxattr attrib;
        const char *xfs_filename="/opt/public/Read Me.txt";
        int fd=open(xfs_filename, O_RDONLY);

        if(fd < 0)
                DIE("Couldn't open file");
        // Get extended attributes for file
        if(xfsctl(xfs_filename, fd, XFS_IOC_FSGETXATTR, &attrib) != 0)
                DIE("Couldn't read attributes");

        // Set the realtime status bit
        attrib.fsx_xflags |= XFS_XFLAG_REALTIME;

        // Attempt to set these attributes on the file
        if(xfsctl(xfs_filename, fd, XFS_IOC_FSSETXATTR, &attrib) != 0)
                DIE("Couldn't set attributes");

        close(fd);
        return(0);
EXIT_FAIL:
        if(fd >= 0) close(fd);
        return(1);
}

It didn't need any special libraries to link.