Skip to content

Commit

Permalink
Merge branch 'kdave-v4.8' into for-linus-4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
masoncl committed Jul 26, 2016
2 parents 8b8b08c + 6664283 commit 023a824
Show file tree
Hide file tree
Showing 45 changed files with 1,074 additions and 826 deletions.
3 changes: 1 addition & 2 deletions fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
}
if (size > 0) {
acl = posix_acl_from_xattr(&init_user_ns, value, size);
} else if (size == -ENOENT || size == -ENODATA || size == 0) {
/* FIXME, who returns -ENOENT? I think nobody */
} else if (size == -ERANGE || size == -ENODATA || size == 0) {
acl = NULL;
} else {
acl = ERR_PTR(-EIO);
Expand Down
31 changes: 25 additions & 6 deletions fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@

struct __btrfs_workqueue {
struct workqueue_struct *normal_wq;

/* File system this workqueue services */
struct btrfs_fs_info *fs_info;

/* List head pointing to ordered work list */
struct list_head ordered_list;

Expand Down Expand Up @@ -70,6 +74,18 @@ void btrfs_##name(struct work_struct *arg) \
normal_work_helper(work); \
}

struct btrfs_fs_info *
btrfs_workqueue_owner(struct __btrfs_workqueue *wq)
{
return wq->fs_info;
}

struct btrfs_fs_info *
btrfs_work_owner(struct btrfs_work *work)
{
return work->wq->fs_info;
}

BTRFS_WORK_HELPER(worker_helper);
BTRFS_WORK_HELPER(delalloc_helper);
BTRFS_WORK_HELPER(flush_delalloc_helper);
Expand All @@ -94,14 +110,15 @@ BTRFS_WORK_HELPER(scrubnc_helper);
BTRFS_WORK_HELPER(scrubparity_helper);

static struct __btrfs_workqueue *
__btrfs_alloc_workqueue(const char *name, unsigned int flags, int limit_active,
int thresh)
__btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info, const char *name,
unsigned int flags, int limit_active, int thresh)
{
struct __btrfs_workqueue *ret = kzalloc(sizeof(*ret), GFP_KERNEL);

if (!ret)
return NULL;

ret->fs_info = fs_info;
ret->limit_active = limit_active;
atomic_set(&ret->pending, 0);
if (thresh == 0)
Expand Down Expand Up @@ -143,7 +160,8 @@ __btrfs_alloc_workqueue(const char *name, unsigned int flags, int limit_active,
static inline void
__btrfs_destroy_workqueue(struct __btrfs_workqueue *wq);

struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info,
const char *name,
unsigned int flags,
int limit_active,
int thresh)
Expand All @@ -153,16 +171,17 @@ struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
if (!ret)
return NULL;

ret->normal = __btrfs_alloc_workqueue(name, flags & ~WQ_HIGHPRI,
ret->normal = __btrfs_alloc_workqueue(fs_info, name,
flags & ~WQ_HIGHPRI,
limit_active, thresh);
if (!ret->normal) {
kfree(ret);
return NULL;
}

if (flags & WQ_HIGHPRI) {
ret->high = __btrfs_alloc_workqueue(name, flags, limit_active,
thresh);
ret->high = __btrfs_alloc_workqueue(fs_info, name, flags,
limit_active, thresh);
if (!ret->high) {
__btrfs_destroy_workqueue(ret->normal);
kfree(ret);
Expand Down
6 changes: 5 additions & 1 deletion fs/btrfs/async-thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define __BTRFS_ASYNC_THREAD_
#include <linux/workqueue.h>

struct btrfs_fs_info;
struct btrfs_workqueue;
/* Internal use only */
struct __btrfs_workqueue;
Expand Down Expand Up @@ -67,7 +68,8 @@ BTRFS_WORK_HELPER_PROTO(scrubnc_helper);
BTRFS_WORK_HELPER_PROTO(scrubparity_helper);


struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name,
struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info,
const char *name,
unsigned int flags,
int limit_active,
int thresh);
Expand All @@ -80,4 +82,6 @@ void btrfs_queue_work(struct btrfs_workqueue *wq,
void btrfs_destroy_workqueue(struct btrfs_workqueue *wq);
void btrfs_workqueue_set_max(struct btrfs_workqueue *wq, int max);
void btrfs_set_work_high_priority(struct btrfs_work *work);
struct btrfs_fs_info *btrfs_work_owner(struct btrfs_work *work);
struct btrfs_fs_info *btrfs_workqueue_owner(struct __btrfs_workqueue *wq);
#endif
4 changes: 2 additions & 2 deletions fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ int __init btrfs_prelim_ref_init(void)
btrfs_prelim_ref_cache = kmem_cache_create("btrfs_prelim_ref",
sizeof(struct __prelim_ref),
0,
SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD,
SLAB_MEM_SPREAD,
NULL);
if (!btrfs_prelim_ref_cache)
return -ENOMEM;
Expand Down Expand Up @@ -361,7 +361,7 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info,
goto out;
}

if (btrfs_test_is_dummy_root(root)) {
if (btrfs_is_testing(fs_info)) {
srcu_read_unlock(&fs_info->subvol_srcu, index);
ret = -ENOENT;
goto out;
Expand Down
10 changes: 8 additions & 2 deletions fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
}

ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
BUG_ON(ret); /* -ENOMEM */
if (ret) {
bio->bi_error = ret;
bio_endio(bio);
}

bio_put(bio);

Expand Down Expand Up @@ -432,7 +435,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
}

ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
BUG_ON(ret); /* -ENOMEM */
if (ret) {
bio->bi_error = ret;
bio_endio(bio);
}

bio_put(bio);
return 0;
Expand Down
Loading

0 comments on commit 023a824

Please sign in to comment.