Skip to content

Commit 5ef64a3

Browse files
committed
Merge branch 'cleanups-4.7' into for-chris-4.7-20160516
2 parents 73d32ce + e1860a7 commit 5ef64a3

15 files changed

+176
-190
lines changed

fs/btrfs/ctree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
10111011
return ret;
10121012
if (refs == 0) {
10131013
ret = -EROFS;
1014-
btrfs_std_error(root->fs_info, ret, NULL);
1014+
btrfs_handle_fs_error(root->fs_info, ret, NULL);
10151015
return ret;
10161016
}
10171017
} else {
@@ -1928,7 +1928,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
19281928
child = read_node_slot(root, mid, 0);
19291929
if (!child) {
19301930
ret = -EROFS;
1931-
btrfs_std_error(root->fs_info, ret, NULL);
1931+
btrfs_handle_fs_error(root->fs_info, ret, NULL);
19321932
goto enospc;
19331933
}
19341934

@@ -2031,7 +2031,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
20312031
*/
20322032
if (!left) {
20332033
ret = -EROFS;
2034-
btrfs_std_error(root->fs_info, ret, NULL);
2034+
btrfs_handle_fs_error(root->fs_info, ret, NULL);
20352035
goto enospc;
20362036
}
20372037
wret = balance_node_right(trans, root, mid, left);

fs/btrfs/ctree.h

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4327,10 +4327,9 @@ static inline void assfail(char *expr, char *file, int line)
43274327
#define ASSERT(expr) ((void)0)
43284328
#endif
43294329

4330-
#define btrfs_assert()
43314330
__printf(5, 6)
43324331
__cold
4333-
void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
4332+
void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function,
43344333
unsigned int line, int errno, const char *fmt, ...);
43354334

43364335
const char *btrfs_decode_error(int errno);
@@ -4340,6 +4339,46 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
43404339
struct btrfs_root *root, const char *function,
43414340
unsigned int line, int errno);
43424341

4342+
/*
4343+
* Call btrfs_abort_transaction as early as possible when an error condition is
4344+
* detected, that way the exact line number is reported.
4345+
*/
4346+
#define btrfs_abort_transaction(trans, root, errno) \
4347+
do { \
4348+
/* Report first abort since mount */ \
4349+
if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \
4350+
&((root)->fs_info->fs_state))) { \
4351+
WARN(1, KERN_DEBUG \
4352+
"BTRFS: Transaction aborted (error %d)\n", \
4353+
(errno)); \
4354+
} \
4355+
__btrfs_abort_transaction((trans), (root), __func__, \
4356+
__LINE__, (errno)); \
4357+
} while (0)
4358+
4359+
#define btrfs_handle_fs_error(fs_info, errno, fmt, args...) \
4360+
do { \
4361+
__btrfs_handle_fs_error((fs_info), __func__, __LINE__, \
4362+
(errno), fmt, ##args); \
4363+
} while (0)
4364+
4365+
__printf(5, 6)
4366+
__cold
4367+
void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function,
4368+
unsigned int line, int errno, const char *fmt, ...);
4369+
/*
4370+
* If BTRFS_MOUNT_PANIC_ON_FATAL_ERROR is in mount_opt, __btrfs_panic
4371+
* will panic(). Otherwise we BUG() here.
4372+
*/
4373+
#define btrfs_panic(fs_info, errno, fmt, args...) \
4374+
do { \
4375+
__btrfs_panic(fs_info, __func__, __LINE__, errno, fmt, ##args); \
4376+
BUG(); \
4377+
} while (0)
4378+
4379+
4380+
/* compatibility and incompatibility defines */
4381+
43434382
#define btrfs_set_fs_incompat(__fs_info, opt) \
43444383
__btrfs_set_fs_incompat((__fs_info), BTRFS_FEATURE_INCOMPAT_##opt)
43454384

@@ -4456,44 +4495,6 @@ static inline int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag)
44564495
return !!(btrfs_super_compat_ro_flags(disk_super) & flag);
44574496
}
44584497

4459-
/*
4460-
* Call btrfs_abort_transaction as early as possible when an error condition is
4461-
* detected, that way the exact line number is reported.
4462-
*/
4463-
#define btrfs_abort_transaction(trans, root, errno) \
4464-
do { \
4465-
/* Report first abort since mount */ \
4466-
if (!test_and_set_bit(BTRFS_FS_STATE_TRANS_ABORTED, \
4467-
&((root)->fs_info->fs_state))) { \
4468-
WARN(1, KERN_DEBUG \
4469-
"BTRFS: Transaction aborted (error %d)\n", \
4470-
(errno)); \
4471-
} \
4472-
__btrfs_abort_transaction((trans), (root), __func__, \
4473-
__LINE__, (errno)); \
4474-
} while (0)
4475-
4476-
#define btrfs_std_error(fs_info, errno, fmt, args...) \
4477-
do { \
4478-
__btrfs_std_error((fs_info), __func__, __LINE__, \
4479-
(errno), fmt, ##args); \
4480-
} while (0)
4481-
4482-
__printf(5, 6)
4483-
__cold
4484-
void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function,
4485-
unsigned int line, int errno, const char *fmt, ...);
4486-
4487-
/*
4488-
* If BTRFS_MOUNT_PANIC_ON_FATAL_ERROR is in mount_opt, __btrfs_panic
4489-
* will panic(). Otherwise we BUG() here.
4490-
*/
4491-
#define btrfs_panic(fs_info, errno, fmt, args...) \
4492-
do { \
4493-
__btrfs_panic(fs_info, __func__, __LINE__, errno, fmt, ##args); \
4494-
BUG(); \
4495-
} while (0)
4496-
44974498
/* acl.c */
44984499
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
44994500
struct posix_acl *btrfs_get_acl(struct inode *inode, int type);

fs/btrfs/delayed-inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static struct btrfs_delayed_node *btrfs_get_or_create_delayed_node(
134134
/* cached in the btrfs inode and can be accessed */
135135
atomic_add(2, &node->refs);
136136

137-
ret = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM);
137+
ret = radix_tree_preload(GFP_NOFS);
138138
if (ret) {
139139
kmem_cache_free(delayed_node_cache, node);
140140
return ERR_PTR(ret);

0 commit comments

Comments
 (0)