diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blk-cgroup.h | 21 | ||||
| -rw-r--r-- | include/linux/drbd.h | 2 | ||||
| -rw-r--r-- | include/linux/genl_magic_struct.h | 5 |
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 | */ |
| 500 | static inline bool blkg_tryget(struct blkcg_gq *blkg) | 500 | static 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 | */ |
| 512 | static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg) | 514 | static 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 | ||
| 53 | extern const char *drbd_buildtag(void); | 53 | extern 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) | |||
| 218 | static inline void ct_assert_unique_ ## s_name ## _attributes(void) \ | 220 | static 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 | } |
