diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/bsg-lib.h | 5 | ||||
-rw-r--r-- | include/linux/rcupdate.h | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h index 637a20cfb237..b1be0233ce35 100644 --- a/include/linux/bsg-lib.h +++ b/include/linux/bsg-lib.h @@ -68,8 +68,9 @@ struct bsg_job { void bsg_job_done(struct bsg_job *job, int result, unsigned int reply_payload_rcv_len); -struct request_queue *bsg_setup_queue(struct device *dev, char *name, - bsg_job_fn *job_fn, int dd_job_size); +struct request_queue *bsg_setup_queue(struct device *dev, const char *name, + bsg_job_fn *job_fn, int dd_job_size, + void (*release)(struct device *)); void bsg_job_put(struct bsg_job *job); int __must_check bsg_job_get(struct bsg_job *job); diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 96f1baf62ab8..de50d8a4cf41 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -413,6 +413,22 @@ static inline void rcu_preempt_sleep_check(void) { } }) /** + * rcu_swap_protected() - swap an RCU and a regular pointer + * @rcu_ptr: RCU pointer + * @ptr: regular pointer + * @c: the conditions under which the dereference will take place + * + * Perform swap(@rcu_ptr, @ptr) where @rcu_ptr is an RCU-annotated pointer and + * @c is the argument that is passed to the rcu_dereference_protected() call + * used to read that pointer. + */ +#define rcu_swap_protected(rcu_ptr, ptr, c) do { \ + typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c)); \ + rcu_assign_pointer((rcu_ptr), (ptr)); \ + (ptr) = __tmp; \ +} while (0) + +/** * rcu_access_pointer() - fetch RCU pointer with no dereferencing * @p: The pointer to read * |