Skip to content

Commit

Permalink
Update bcachefs sources to 9404a01d3dc5 bcachefs: Make read_only a mo…
Browse files Browse the repository at this point in the history
…unt option again, but hidden

Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Jun 28, 2024
1 parent b0eb3c2 commit 34b5654
Show file tree
Hide file tree
Showing 49 changed files with 1,003 additions and 837 deletions.
2 changes: 1 addition & 1 deletion .bcachefs_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
792ca5ba3c9a07d762d9c1a440e31c0520f37de0
9404a01d3dc5553b106fa590602f4771b8e0b8ae
7 changes: 7 additions & 0 deletions include/linux/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ typedef struct {

#define __ATOMIC_READ(p) uatomic_read(p)
#define __ATOMIC_SET(p, v) uatomic_set(p, v)
#define __ATOMIC_SET_RELEASE(p, v) uatomic_set(p, v)
#define __ATOMIC_ADD_RETURN(v, p) uatomic_add_return(p, v)
#define __ATOMIC_SUB_RETURN(v, p) uatomic_sub_return(p, v)
#define __ATOMIC_ADD(v, p) uatomic_add(p, v)
Expand Down Expand Up @@ -64,6 +65,7 @@ typedef struct {

#define __ATOMIC_READ(p) __atomic_load_n(p, __ATOMIC_RELAXED)
#define __ATOMIC_SET(p, v) __atomic_store_n(p, v, __ATOMIC_RELAXED)
#define __ATOMIC_SET_RELEASE(p, v) __atomic_store_n(p, v, __ATOMIC_RELEASE)
#define __ATOMIC_ADD_RETURN(v, p) __atomic_add_fetch(p, v, __ATOMIC_RELAXED)
#define __ATOMIC_ADD_RETURN_RELEASE(v, p) \
__atomic_add_fetch(p, v, __ATOMIC_RELEASE)
Expand Down Expand Up @@ -189,6 +191,11 @@ static inline void a_type##_set(a_type##_t *v, i_type i) \
return __ATOMIC_SET(&v->counter, i); \
} \
\
static inline void a_type##_set_release(a_type##_t *v, i_type i) \
{ \
return __ATOMIC_SET_RELEASE(&v->counter, i); \
} \
\
static inline i_type a_type##_add_return(i_type i, a_type##_t *v) \
{ \
return __ATOMIC_ADD_RETURN(i, &v->counter); \
Expand Down
23 changes: 23 additions & 0 deletions include/linux/closure.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,21 @@ static inline void closure_get(struct closure *cl)
#endif
}

/**
* closure_get_not_zero
*/
static inline bool closure_get_not_zero(struct closure *cl)
{
unsigned old = atomic_read(&cl->remaining);
do {
if (!(old & CLOSURE_REMAINING_MASK))
return false;

} while (!atomic_try_cmpxchg_acquire(&cl->remaining, &old, old + 1));

return true;
}

/**
* closure_init - Initialize a closure, setting the refcount to 1
* @cl: closure to initialize
Expand All @@ -310,6 +325,12 @@ static inline void closure_init_stack(struct closure *cl)
atomic_set(&cl->remaining, CLOSURE_REMAINING_INITIALIZER);
}

static inline void closure_init_stack_release(struct closure *cl)
{
memset(cl, 0, sizeof(struct closure));
atomic_set_release(&cl->remaining, CLOSURE_REMAINING_INITIALIZER);
}

/**
* closure_wake_up - wake up all closures on a wait list,
* with memory barrier
Expand Down Expand Up @@ -355,6 +376,8 @@ do { \
*/
#define closure_return(_cl) continue_at((_cl), NULL, NULL)

void closure_return_sync(struct closure *cl);

/**
* continue_at_nobarrier - jump to another function without barrier
*
Expand Down
2 changes: 1 addition & 1 deletion include/linux/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ extern void workqueue_set_max_active(struct workqueue_struct *wq,
extern bool current_is_workqueue_rescuer(void);
extern bool workqueue_congested(int cpu, struct workqueue_struct *wq);
extern unsigned int work_busy(struct work_struct *work);
extern __printf(1, 2) void set_worker_desc(const char *fmt, ...);
static inline __printf(1, 2) void set_worker_desc(const char *fmt, ...) {}
extern void print_worker_info(const char *log_lvl, struct task_struct *task);
extern void show_workqueue_state(void);

Expand Down
Loading

0 comments on commit 34b5654

Please sign in to comment.