Skip to content

Commit c603970

Browse files
lorddoskiaskdave
authored andcommitted
btrfs-progs: Add delayed refs infrastructure
This commit pulls those portions of the kernel implementation of delayed refs which are necessary to have them working in user-space. I've done the following modifications: 1. Replaced all kmem_cache_alloc calls to kmalloc. 2. Removed all locking-related code, since we are single threaded in userspace. 3. Removed code which deals with data refs - delayed refs in user space are going to be used only for cowonly trees. Signed-off-by: Nikolay Borisov <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 3c8faad commit c603970

File tree

7 files changed

+1058
-1
lines changed

7 files changed

+1058
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \
116116
qgroup.o free-space-cache.o kernel-lib/list_sort.o props.o \
117117
kernel-shared/ulist.o qgroup-verify.o backref.o string-table.o task-utils.o \
118118
inode.o file.o find-root.o free-space-tree.o help.o send-dump.o \
119-
fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.o transaction.o
119+
fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.o transaction.o \
120+
delayed-ref.o
120121
cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
121122
cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
122123
cmds-quota.o cmds-qgroup.o cmds-replace.o check/main.o \

ctree.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,4 +2790,7 @@ int btrfs_punch_hole(struct btrfs_trans_handle *trans,
27902790
int btrfs_read_file(struct btrfs_root *root, u64 ino, u64 start, int len,
27912791
char *dest);
27922792

2793+
/* extent-tree.c */
2794+
int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, unsigned long nr);
2795+
27932796
#endif

0 commit comments

Comments
 (0)