]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: introduce btrfs_{start, end}_nocow_write() for each subvolume
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 6 Mar 2014 05:38:19 +0000 (13:38 +0800)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:17:22 +0000 (15:17 -0400)
commitda3ba2ae448738d89b66a4add04ad379027f37c2
treec8e501b32a70f731b00a26795f9063b0a5088f8d
parentb19175a0acc874abd329020a64e4da619a73e992
Btrfs: introduce btrfs_{start, end}_nocow_write() for each subvolume

If the snapshot creation happened after the nocow write but before the dirty
data flush, we would fail to flush the dirty data because of no space.

So we must keep track of when those nocow write operations start and when they
end, if there are nocow writers, the snapshot creators must wait. In order
to implement this function, I introduce btrfs_{start, end}_nocow_write(),
which is similar to mnt_{want,drop}_write().

These two functions are only used for nocow file write operations.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/ioctl.c