Skip to content

Commit

Permalink
btrfs-progs: Add delayed refs infrastructure
Browse files Browse the repository at this point in the history
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 <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
lorddoskias authored and kdave committed Oct 23, 2018
1 parent 3c8faad commit c603970
Show file tree
Hide file tree
Showing 7 changed files with 1,058 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \
qgroup.o free-space-cache.o kernel-lib/list_sort.o props.o \
kernel-shared/ulist.o qgroup-verify.o backref.o string-table.o task-utils.o \
inode.o file.o find-root.o free-space-tree.o help.o send-dump.o \
fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.o transaction.o
fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.o transaction.o \
delayed-ref.o
cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
cmds-quota.o cmds-qgroup.o cmds-replace.o check/main.o \
Expand Down
3 changes: 3 additions & 0 deletions ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2790,4 +2790,7 @@ int btrfs_punch_hole(struct btrfs_trans_handle *trans,
int btrfs_read_file(struct btrfs_root *root, u64 ino, u64 start, int len,
char *dest);

/* extent-tree.c */
int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, unsigned long nr);

#endif
Loading

0 comments on commit c603970

Please sign in to comment.