Blame SOURCES/BZ-1091698-fs-snapshot-obsolete-btrfsctl.patch

fe6837
commit 92fd923f75f1f42d246e925f1c4526f36f6fd88d
fe6837
Author: Stephen Degler <stephen@degler.net>
fe6837
Date:   Tue Sep 24 17:06:14 2013 +0200
fe6837
fe6837
    fs-snapshot: btrfsctl is obsolete, use btrfs. BZ 1010974
fe6837
fe6837
diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py
fe6837
index 4f99b6a..786b0c1 100644
fe6837
--- a/plugins/fs-snapshot/fs-snapshot.py
fe6837
+++ b/plugins/fs-snapshot/fs-snapshot.py
fe6837
@@ -198,9 +198,8 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume):
fe6837
     """
fe6837
     Runs the commands necessary for a snapshot.  Basically its just
fe6837
 
fe6837
-    btrfsctl -c /dir/to/snapshot    #this syncs the fs
fe6837
-    btrfsctl -s /dir/to/snapshot/${snapshot_tag}
fe6837
-                /dir/to/snapshot
fe6837
+    btrfs filesystem sync /dir/to/snapshot    #this syncs the fs
fe6837
+    btrfs subvolume snapshot /dir/to/snapshot /dir/to/snapshot/${snapshot_tag}
fe6837
 
fe6837
     and then we're done.
fe6837
     """
fe6837
@@ -212,11 +211,11 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume):
fe6837
 
fe6837
     snapname = mntpnt + snapshot_tag
fe6837
     conduit.info(1, "fs-snapshot: snapshotting " + mntpnt + ": " + snapname)
fe6837
-    p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE)
fe6837
+    p = Popen(["/sbin/btrfs", "filesystem", "sync", mntpnt], stdout=PIPE, stderr=PIPE)
fe6837
     err = p.wait()
fe6837
     if err:
fe6837
         return 1
fe6837
-    p = Popen(["/sbin/btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE)
fe6837
+    p = Popen(["/sbin/btrfs", "subvolume", "snapshot", mntpnt, snapname], stdout=PIPE, stderr=PIPE)
fe6837
     err = p.wait()
fe6837
     if err:
fe6837
         return 1