File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ struct ucma_file {
85
85
struct ucma_context {
86
86
u32 id ;
87
87
struct completion comp ;
88
- atomic_t ref ;
88
+ refcount_t ref ;
89
89
int events_reported ;
90
90
int backlog ;
91
91
@@ -152,15 +152,15 @@ static struct ucma_context *ucma_get_ctx(struct ucma_file *file, int id)
152
152
if (ctx -> closing )
153
153
ctx = ERR_PTR (- EIO );
154
154
else
155
- atomic_inc (& ctx -> ref );
155
+ refcount_inc (& ctx -> ref );
156
156
}
157
157
xa_unlock (& ctx_table );
158
158
return ctx ;
159
159
}
160
160
161
161
static void ucma_put_ctx (struct ucma_context * ctx )
162
162
{
163
- if (atomic_dec_and_test (& ctx -> ref ))
163
+ if (refcount_dec_and_test (& ctx -> ref ))
164
164
complete (& ctx -> comp );
165
165
}
166
166
@@ -212,7 +212,7 @@ static struct ucma_context *ucma_alloc_ctx(struct ucma_file *file)
212
212
return NULL ;
213
213
214
214
INIT_WORK (& ctx -> close_work , ucma_close_id );
215
- atomic_set (& ctx -> ref , 1 );
215
+ refcount_set (& ctx -> ref , 1 );
216
216
init_completion (& ctx -> comp );
217
217
INIT_LIST_HEAD (& ctx -> mc_list );
218
218
ctx -> file = file ;
@@ -1502,7 +1502,7 @@ static ssize_t ucma_leave_multicast(struct ucma_file *file,
1502
1502
mc = ERR_PTR (- ENOENT );
1503
1503
else if (mc -> ctx -> file != file )
1504
1504
mc = ERR_PTR (- EINVAL );
1505
- else if (!atomic_inc_not_zero (& mc -> ctx -> ref ))
1505
+ else if (!refcount_inc_not_zero (& mc -> ctx -> ref ))
1506
1506
mc = ERR_PTR (- ENXIO );
1507
1507
else
1508
1508
__xa_erase (& multicast_table , mc -> id );
You can’t perform that action at this time.
0 commit comments