-
Notifications
You must be signed in to change notification settings - Fork 4
User kernel API
Amir Goldstein edited this page May 29, 2016
·
3 revisions
This page was created to help simplifying the user-kernel API for Next3 snapshots, according to suggestions of Ted T'so.
For internal kernel API, see Code documentation#Snapshot_kernel_API.
Script command: "next3 take NAME"
Current API:
# chattr +x <mntdir>/.snapshots # touch <mntdir>/.snapshots/<snapfile> # chattr -X +S <mntdir>/.snapshots/<snapfile>
Simplified API:
# touch <mntdir>/.snapshots/<snapfile>
TODO: Create .snapshots directory on mkfs.next3.
TODO: Invoke snapshot take from create command.
Script command: "next3 mount NAME"
Current API:
# chattr -X +n <mntdir>/.snapshots/<snapfile> # mount -r -t ext2 -o loop <mntdir>/.snapshots/<snapfile> <snapmnt>
Simplified API:
# mount -r -o loop,noload <mntdir>/.snapshots/<snapfile> <snapmnt>
TODO: Auto-enable snapshot on snapshot file open.
Script command: "next3 remove NAME"
Current API:
# umount -d <snapmnt> # chattr -X -n <mntdir>/.snapshots>/<snapfile> # chattr -X -S <mntdir>/.snapshots/<snapfile> # rm <mntdir>/.snapshots/<snapfile> (may fail if snapshot file is in use)
Simplified API:
# umount <snapmnt> # rm <mntdir>/.snapshots/<snapfile> (queue snapshot for deletion and return EBUSY if snapshot file is in use)
TODO: Auto-disable snapshot on last snapshot file close.
TODO: Invoke snapshot delete from unlink command.
Script command: "next3 stat"
Current API:
# lsattr -X <mntdir>/.snapshots
New API:
# lssnap <mntdir>/.snapshots