remarkable-linux/fs/btrfs
Jan Schmidt b382a324b6 Btrfs: fix qgroup rescan resume on mount
When called during mount, we cannot start the rescan worker thread until
open_ctree is done. This commit restuctures the qgroup rescan internals to
enable a clean deferral of the rescan resume operation.

First of all, the struct qgroup_rescan is removed, saving us a malloc and
some initialization synchronizations problems. Its only element (the worker
struct) now lives within fs_info just as the rest of the rescan code.

Then setting up a rescan worker is split into several reusable stages.
Currently we have three different rescan startup scenarios:
	(A) rescan ioctl
	(B) rescan resume by mount
	(C) rescan by quota enable

Each case needs its own combination of the four following steps:
	(1) set the progress [A, C: zero; B: state of umount]
	(2) commit the transaction [A]
	(3) set the counters [A, C: zero; B: state of umount]
	(4) start worker [A, B, C]

qgroup_rescan_init does step (1). There's no extra function added to commit
a transaction, we've got that already. qgroup_rescan_zero_tracking does
step (3). Step (4) is nothing more than a call to the generic
btrfs_queue_worker.

We also get rid of a double check for the rescan progress during
btrfs_qgroup_account_ref, which is no longer required due to having step 2
from the list above.

As a side effect, this commit prepares to move the rescan start code from
btrfs_run_qgroups (which is run during commit) to a less time critical
section.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
2013-06-14 11:30:10 -04:00
..
acl.c Btrfs: skip adding an acl attribute if we don't have to 2012-12-16 20:46:15 -05:00
async-thread.c Btrfs: call the ordered free operation without any locks held 2012-07-25 16:15:07 -04:00
async-thread.h
backref.c Btrfs: fix possible memory leak in the find_parent_nodes() 2013-05-17 21:40:17 -04:00
backref.h btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
btrfs_inode.h btrfs: fix minor typo in comment 2013-05-06 15:54:49 -04:00
check-integrity.c Btrfs: use a btrfs bioset instead of abusing bio internals 2013-05-17 21:52:52 -04:00
check-integrity.h
compat.h
compression.c btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
compression.h btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
ctree.c Btrfs: check if leaf's parent exists before pushing items around 2013-06-14 11:29:58 -04:00
ctree.h Btrfs: fix qgroup rescan resume on mount 2013-06-14 11:30:10 -04:00
delayed-inode.c Btrfs: delete unused function 2013-06-14 11:29:28 -04:00
delayed-inode.h Btrfs: improve the delayed inode throttling 2013-03-07 07:52:40 -05:00
delayed-ref.c Btrfs: separate sequence numbers for delayed ref tracking and tree mod log 2013-05-06 15:55:17 -04:00
delayed-ref.h Btrfs: handle running extent ops with skinny metadata 2013-05-17 21:40:15 -04:00
dev-replace.c Btrfs: introduce per-subvolume ordered extent list 2013-06-14 11:29:41 -04:00
dev-replace.h Btrfs: add new sources for device replace code 2012-12-12 17:15:41 -05:00
dir-item.c btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
disk-io.c Btrfs: fix qgroup rescan resume on mount 2013-06-14 11:30:10 -04:00
disk-io.h Btrfs: introduce grab/put functions for the root of the fs/file tree 2013-06-14 11:29:38 -04:00
export.c Btrfs: cleanup: don't check the same thing twice 2013-06-14 11:29:30 -04:00
export.h
extent-tree.c Btrfs: simplify unlink reservations 2013-06-14 11:30:06 -04:00
extent_io.c btrfs: add debug check for extent_io range alignment 2013-06-14 11:29:15 -04:00
extent_io.h Btrfs: use a btrfs bioset instead of abusing bio internals 2013-05-17 21:52:52 -04:00
extent_map.c btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
extent_map.h Btrfs: fix bad extent logging 2013-05-06 15:54:34 -04:00
file-item.c btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
file.c Btrfs: cleanup: don't check the same thing twice 2013-06-14 11:29:30 -04:00
free-space-cache.c Btrfs: return error code in btrfs_check_trunc_cache_free_space() 2013-06-14 11:29:56 -04:00
free-space-cache.h btrfs: move ifdef around sanity checks out of init_btrfs_fs 2013-06-14 11:29:18 -04:00
hash.h btrfs: extended inode refs 2012-10-09 09:14:45 -04:00
inode-item.c btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
inode-map.c Btrfs: don't use global block reservation for inode cache truncation 2013-05-17 21:40:22 -04:00
inode-map.h
inode.c Btrfs: simplify unlink reservations 2013-06-14 11:30:06 -04:00
ioctl.c Btrfs: allow file data clone within a file 2013-06-14 11:30:03 -04:00
Kconfig btrfs: move leak debug code to functions 2013-05-06 15:55:16 -04:00
locking.c btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
locking.h Btrfs: remove btrfs_try_spin_lock 2013-03-14 14:57:10 -04:00
lzo.c
Makefile Btrfs: RAID5 and RAID6 2013-02-01 14:24:23 -05:00
math.h Btrfs: cleanup duplicated division functions 2012-12-11 13:31:30 -05:00
ordered-data.c Btrfs: introduce per-subvolume ordered extent list 2013-06-14 11:29:41 -04:00
ordered-data.h Btrfs: introduce per-subvolume ordered extent list 2013-06-14 11:29:41 -04:00
orphan.c
print-tree.c Btrfs: Include the device in most error printk()s 2013-05-06 15:54:23 -04:00
print-tree.h btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
qgroup.c Btrfs: fix qgroup rescan resume on mount 2013-06-14 11:30:10 -04:00
raid56.c Btrfs: use a btrfs bioset instead of abusing bio internals 2013-05-17 21:52:52 -04:00
raid56.h Btrfs: RAID5 and RAID6 2013-02-01 14:24:23 -05:00
rcu-string.h
reada.c Btrfs: fix reada debug code compilation 2013-05-06 15:54:55 -04:00
relocation.c Btrfs: introduce per-subvolume ordered extent list 2013-06-14 11:29:41 -04:00
root-tree.c Btrfs: remove unused code in btrfs_del_root 2013-06-14 11:30:02 -04:00
scrub.c Btrfs: use a btrfs bioset instead of abusing bio internals 2013-05-17 21:52:52 -04:00
send.c Btrfs: fix estale with btrfs send 2013-06-14 11:29:55 -04:00
send.h btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
struct-funcs.c Btrfs: rewrite BTRFS_SETGET_FUNCS 2012-07-23 16:28:06 -04:00
super.c Btrfs: do delay iput in sync_fs 2013-06-14 11:29:52 -04:00
sysfs.c btrfs: fixup/remove module.h usage as required 2013-03-01 15:01:01 -05:00
transaction.c Btrfs: merge pending IO for tree log write back 2013-06-14 11:30:05 -04:00
transaction.h Btrfs: make the state of the transaction more readable 2013-06-14 11:29:51 -04:00
tree-defrag.c btrfs: remove cache only arguments from defrag path 2013-02-20 12:59:36 -05:00
tree-log.c Btrfs: merge pending IO for tree log write back 2013-06-14 11:30:05 -04:00
tree-log.h btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
ulist.c Btrfs: add a rb_tree to improve performance of ulist search 2013-05-06 15:54:44 -04:00
ulist.h Btrfs: add a rb_tree to improve performance of ulist search 2013-05-06 15:54:44 -04:00
volumes.c btrfs: device delete to get errors from the kernel 2013-06-14 11:29:53 -04:00
volumes.h Btrfs: cleanup the similar code of the fs root read 2013-06-14 11:29:37 -04:00
xattr.c btrfs: make static code static & remove dead code 2013-05-06 15:55:23 -04:00
xattr.h
zlib.c btrfs: fix message printing 2012-10-09 09:19:57 -04:00