mnt_reset_table(table);
}
- void load()
+ void parse_fstab()
{
if (mnt_table_parse_fstab(table, "/etc/fstab") != 0)
throw runtime_error("mnt_table_parse_fstab failed");
}
- void save()
+ void replace_file()
{
if (mnt_table_replace_file(table, "/etc/fstab") != 0)
throw runtime_error("mnt_table_replace_file failed");
string subvol_option = get_subvolume(infos_dir.fd(), id);
MntTable mnt_table;
- mnt_table.load();
+ mnt_table.parse_fstab();
libmnt_fs* root = mnt_table.find_target(subvolume, MNT_ITER_FORWARD);
if (!root)
free(options);
mnt_table.add_fs(snapshots);
- mnt_table.save();
+ mnt_table.replace_file();
}
Btrfs::removeFromFstab() const
{
MntTable mnt_table;
- mnt_table.load();
+ mnt_table.parse_fstab();
string mountpoint = (subvolume == "/" ? "" : subvolume) + "/.snapshots";
libmnt_fs* snapshots = mnt_table.find_target(mountpoint, MNT_ITER_FORWARD);
return;
mnt_table.remove_fs(snapshots);
- mnt_table.save();
+ mnt_table.replace_file();
}
#endif