src/axl_async_bbapi.c
/* Returns 1 if its possible to transfer a file from the src to dst using the
 * BBAPI. In general (but not all cases) BBAPI can transfer between filesystems
 * if they both support extents.  EXT4 <-> gpfs is one exception.
 *
 * Returns 0 if BBAPI can not transfer from src to dst. */
Returns 1 if its possible to transfer a file from the src to dst using the
BBAPI. In general (but not all cases) BBAPI can transfer between filesystems
if they both support extents.  EXT4 <-> gpfs is one exception.

Returns 0 if BBAPI can not transfer from src to dst.
Returns 1 if its possible to transfer a file from the src to dst using the BBAPI . In general ( but not all cases ) BBAPI can transfer between filesystems if they both support extents . EXT4 < - > gpfs is one exception . Returns 0 if BBAPI can not transfer from src to dst .
int bbapi_copy_is_compatible(char* src, char* dst)
{
    const __fsword_t whitelist[] = {
        XFS_SUPER_MAGIC,
        GPFS_SUPER_MAGIC,
        EXT4_SUPER_MAGIC,
    };
    __fsword_t source = axl_get_fs_magic(src);
    __fsword_t dest   = axl_get_fs_magic(dst);
    if ((source == EXT4_SUPER_MAGIC && dest == GPFS_SUPER_MAGIC) ||
        (source == GPFS_SUPER_MAGIC && dest == EXT4_SUPER_MAGIC))
    {
        return 0;
    }
    int found_source = 0;
    int found_dest   = 0;
    int i;
    for (i = 0; i < sizeof(whitelist) / sizeof(whitelist[0]); i++) {
        if (source == whitelist[i]) {
            found_source = 1;
        }
        if (dest == whitelist[i]) {
            found_dest = 1;
        }
    }
    if (found_source && found_dest) {
        return 1;
    }
    return 0;
}
int bbapi_copy_is_compatible ( char * src , char * dst ) { const __fsword_t whitelist [ ] = { XFS_SUPER_MAGIC , GPFS_SUPER_MAGIC , EXT4_SUPER_MAGIC , } ; __fsword_t source = axl_get_fs_magic ( src ) ; __fsword_t dest = axl_get_fs_magic ( dst ) ; if ( ( source == EXT4_SUPER_MAGIC && dest == GPFS_SUPER_MAGIC ) || ( source == GPFS_SUPER_MAGIC && dest == EXT4_SUPER_MAGIC ) ) { return 0 ; } int found_source = 0 ; int found_dest = 0 ; int i ; for ( i = 0 ; i < sizeof ( whitelist ) / sizeof ( whitelist [ 0 ] ) ; i ++ ) { if ( source == whitelist [ i ] ) { found_source = 1 ; } if ( dest == whitelist [ i ] ) { found_dest = 1 ; } } if ( found_source && found_dest ) { return 1 ; } return 0 ; }
Returns 1 if its possible to transfer a file from the src to dst using the
 BBAPI.
Returns 1 if its possible to transfer a file from the src to dst using the BBAPI .
/* List all filesystem types that are (somewhat) compatible with BBAPI */ /* Exception: EXT4 <-> GPFS transfers are not supported by BBAPI */