summaryrefslogtreecommitdiff
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-11-10 20:54:00 +0300
committerDavid Sterba <dsterba@suse.com>2016-01-07 17:20:54 +0300
commitb0c0ea6338d5018e02d27c5315084fb1a5d099f6 (patch)
treebf2aa288dd2d98143b12ea1753739491c7eda54d /fs/btrfs/transaction.h
parenta1ee736268448d74af25737568e383acb84c3c18 (diff)
downloadlinux-b0c0ea6338d5018e02d27c5315084fb1a5d099f6.tar.xz
btrfs: allocate root item at snapshot ioctl time
The actual snapshot creation is delayed until transaction commit. If we cannot get enough memory for the root item there, we have to fail the whole transaction commit which is bad. So we'll allocate the memory at the ioctl call and pass it along with the pending_snapshot struct. The potential ENOMEM will be returned to the caller of snapshot ioctl. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r--fs/btrfs/transaction.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 64c8221b6165..b6f9a3c94468 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -137,6 +137,7 @@ struct btrfs_pending_snapshot {
struct dentry *dentry;
struct inode *dir;
struct btrfs_root *root;
+ struct btrfs_root_item *root_item;
struct btrfs_root *snap;
struct btrfs_qgroup_inherit *inherit;
/* block reservation for the operation */