src/filed/fd_snapshot.c
static void add_handler(void *user_ctx,
                        struct stat *st,
                        const char *fstype,
                        const char *mountpoint,
                        const char *mntopts,
                        const char *device)
{
   Dmsg5(DT_SNAPSHOT|50, "dev=%ld device=%s mountpoint=%s fstype=%s mntopts=%s\n",
         st->st_dev, device, mountpoint, fstype, mntopts);

   /* TODO: If the fstype is btrfs or zfs, the fs might contains subvolumes,
    * and these subvolumes may not be reported in the mntent list. In this
    * case, we need to call proper btrfs/zfs commands to list them.
    *   # btrfs subvolume list /mnt
    *   ID 256 gen 17 top level 5 path test
    *   ID 259 gen 18 top level 5 path test/titi
    */
   snapshot_manager *snapmgr = (snapshot_manager *)user_ctx;
   snapmgr->add_mount_point(st->st_dev, device, mountpoint, fstype);
}
/* In this handler, we need to fill a mtab structure */
In this handler, we need to fill a mtab structure
In this handler we need to fill a mtab structure
static void add_handler(void *user_ctx,
                        struct stat *st,
                        const char *fstype,
                        const char *mountpoint,
                        const char *mntopts,
                        const char *device)
{
   Dmsg5(DT_SNAPSHOT|50, "dev=%ld device=%s mountpoint=%s fstype=%s mntopts=%s\n",
         st->st_dev, device, mountpoint, fstype, mntopts);
   snapshot_manager *snapmgr = (snapshot_manager *)user_ctx;
   snapmgr->add_mount_point(st->st_dev, device, mountpoint, fstype);
}
static void add_handler ( void * user_ctx , struct stat * st , const char * fstype , const char * mountpoint , const char * mntopts , const char * device ) { Dmsg5 ( DT_SNAPSHOT | 50 , " \n " , st -> st_dev , device , mountpoint , fstype , mntopts ) ; snapshot_manager * snapmgr = ( snapshot_manager * ) user_ctx ; snapmgr -> add_mount_point ( st -> st_dev , device , mountpoint , fstype ) ; }
In this handler, we need to fill a mtab structure
In this handler we need to fill a mtab structure
/* TODO: If the fstype is btrfs or zfs, the fs might contains subvolumes,
    * and these subvolumes may not be reported in the mntent list. In this
    * case, we need to call proper btrfs/zfs commands to list them.
    *   # btrfs subvolume list /mnt
    *   ID 256 gen 17 top level 5 path test
    *   ID 259 gen 18 top level 5 path test/titi
    */