aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-01-02 21:49:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-01-02 21:49:58 -0500
commit77d0b194b2df04a1992f882d96ff4e2bd8bb8fe0 (patch)
tree2bc1800faf8bf6712e693b5a8ea9c1fdecbe1dc7 /include/linux
parentb79f9f93eb483f2757b089bb4e1eb3827a609080 (diff)
parent427c5ce4417cba0801fbf79c8525d1330704759c (diff)
Merge tag 'for-4.21/block-20190102' of git://git.kernel.dk/linux-block
Pull more block updates from Jens Axboe: - Dead code removal for loop/sunvdc (Chengguang) - Mark BIDI support for bsg as deprecated, logging a single dmesg warning if anyone is actually using it (Christoph) - blkcg cleanup, killing a dead function and making the tryget_closest variant easier to read (Dennis) - Floppy fixes, one fixing a regression in swim3 (Finn) - lightnvm use-after-free fix (Gustavo) - gdrom leak fix (Wenwen) - a set of drbd updates (Lars, Luc, Nathan, Roland) * tag 'for-4.21/block-20190102' of git://git.kernel.dk/linux-block: (28 commits) block/swim3: Fix regression on PowerBook G3 block/swim3: Fix -EBUSY error when re-opening device after unmount block/swim3: Remove dead return statement block/amiflop: Don't log error message on invalid ioctl gdrom: fix a memory leak bug lightnvm: pblk: fix use-after-free bug block: sunvdc: remove redundant code block: loop: remove redundant code bsg: deprecate BIDI support in bsg blkcg: remove unused __blkg_release_rcu() blkcg: clean up blkg_tryget_closest() drbd: Change drbd_request_detach_interruptible's return type to int drbd: Avoid Clang warning about pointless switch statment drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire") drbd: skip spurious timeout (ping-timeo) when failing promote drbd: don't retry connection if peers do not agree on "authentication" settings drbd: fix print_st_err()'s prototype to match the definition drbd: avoid spurious self-outdating with concurrent disconnect / down drbd: do not block when adjusting "disk-options" while IO is frozen drbd: fix comment typos ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blk-cgroup.h21
-rw-r--r--include/linux/drbd.h2
-rw-r--r--include/linux/genl_magic_struct.h5
3 files changed, 21 insertions, 7 deletions
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index f025fd1e22e6..76c61318fda5 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -499,22 +499,33 @@ static inline void blkg_get(struct blkcg_gq *blkg)
499 */ 499 */
500static inline bool blkg_tryget(struct blkcg_gq *blkg) 500static inline bool blkg_tryget(struct blkcg_gq *blkg)
501{ 501{
502 return percpu_ref_tryget(&blkg->refcnt); 502 return blkg && percpu_ref_tryget(&blkg->refcnt);
503} 503}
504 504
505/** 505/**
506 * blkg_tryget_closest - try and get a blkg ref on the closet blkg 506 * blkg_tryget_closest - try and get a blkg ref on the closet blkg
507 * @blkg: blkg to get 507 * @blkg: blkg to get
508 * 508 *
509 * This walks up the blkg tree to find the closest non-dying blkg and returns 509 * This needs to be called rcu protected. As the failure mode here is to walk
510 * the blkg that it did association with as it may not be the passed in blkg. 510 * up the blkg tree, this ensure that the blkg->parent pointers are always
511 * valid. This returns the blkg that it ended up taking a reference on or %NULL
512 * if no reference was taken.
511 */ 513 */
512static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg) 514static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg)
513{ 515{
514 while (blkg && !percpu_ref_tryget(&blkg->refcnt)) 516 struct blkcg_gq *ret_blkg = NULL;
517
518 WARN_ON_ONCE(!rcu_read_lock_held());
519
520 while (blkg) {
521 if (blkg_tryget(blkg)) {
522 ret_blkg = blkg;
523 break;
524 }
515 blkg = blkg->parent; 525 blkg = blkg->parent;
526 }
516 527
517 return blkg; 528 return ret_blkg;
518} 529}
519 530
520/** 531/**
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 2d0259327721..a19d98367f08 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -51,7 +51,7 @@
51#endif 51#endif
52 52
53extern const char *drbd_buildtag(void); 53extern const char *drbd_buildtag(void);
54#define REL_VERSION "8.4.10" 54#define REL_VERSION "8.4.11"
55#define API_VERSION 1 55#define API_VERSION 1
56#define PRO_VERSION_MIN 86 56#define PRO_VERSION_MIN 86
57#define PRO_VERSION_MAX 101 57#define PRO_VERSION_MAX 101
diff --git a/include/linux/genl_magic_struct.h b/include/linux/genl_magic_struct.h
index 5972e4969197..eeae59d3ceb7 100644
--- a/include/linux/genl_magic_struct.h
+++ b/include/linux/genl_magic_struct.h
@@ -191,6 +191,7 @@ static inline void ct_assert_unique_operations(void)
191{ 191{
192 switch (0) { 192 switch (0) {
193#include GENL_MAGIC_INCLUDE_FILE 193#include GENL_MAGIC_INCLUDE_FILE
194 case 0:
194 ; 195 ;
195 } 196 }
196} 197}
@@ -209,6 +210,7 @@ static inline void ct_assert_unique_top_level_attributes(void)
209{ 210{
210 switch (0) { 211 switch (0) {
211#include GENL_MAGIC_INCLUDE_FILE 212#include GENL_MAGIC_INCLUDE_FILE
213 case 0:
212 ; 214 ;
213 } 215 }
214} 216}
@@ -218,7 +220,8 @@ static inline void ct_assert_unique_top_level_attributes(void)
218static inline void ct_assert_unique_ ## s_name ## _attributes(void) \ 220static inline void ct_assert_unique_ ## s_name ## _attributes(void) \
219{ \ 221{ \
220 switch (0) { \ 222 switch (0) { \
221 s_fields \ 223 s_fields \
224 case 0: \
222 ; \ 225 ; \
223 } \ 226 } \
224} 227}