File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 17
17
#ifndef _EXT4_H
18
18
#define _EXT4_H
19
19
20
+ #include <linux/refcount.h>
20
21
#include <linux/types.h>
21
22
#include <linux/blkdev.h>
22
23
#include <linux/magic.h>
@@ -241,7 +242,7 @@ typedef struct ext4_io_end {
241
242
struct bio * bio ; /* Linked list of completed
242
243
* bios covering the extent */
243
244
unsigned int flag ; /* unwritten or not */
244
- atomic_t count ; /* reference counter */
245
+ refcount_t count ; /* reference counter */
245
246
struct list_head list_vec ; /* list of ext4_io_end_vec */
246
247
} ext4_io_end_t ;
247
248
Original file line number Diff line number Diff line change @@ -279,14 +279,14 @@ ext4_io_end_t *ext4_init_io_end(struct inode *inode, gfp_t flags)
279
279
io_end -> inode = inode ;
280
280
INIT_LIST_HEAD (& io_end -> list );
281
281
INIT_LIST_HEAD (& io_end -> list_vec );
282
- atomic_set (& io_end -> count , 1 );
282
+ refcount_set (& io_end -> count , 1 );
283
283
}
284
284
return io_end ;
285
285
}
286
286
287
287
void ext4_put_io_end_defer (ext4_io_end_t * io_end )
288
288
{
289
- if (atomic_dec_and_test (& io_end -> count )) {
289
+ if (refcount_dec_and_test (& io_end -> count )) {
290
290
if (!(io_end -> flag & EXT4_IO_END_UNWRITTEN ) ||
291
291
list_empty (& io_end -> list_vec )) {
292
292
ext4_release_io_end (io_end );
@@ -300,7 +300,7 @@ int ext4_put_io_end(ext4_io_end_t *io_end)
300
300
{
301
301
int err = 0 ;
302
302
303
- if (atomic_dec_and_test (& io_end -> count )) {
303
+ if (refcount_dec_and_test (& io_end -> count )) {
304
304
if (io_end -> flag & EXT4_IO_END_UNWRITTEN ) {
305
305
err = ext4_convert_unwritten_io_end_vec (io_end -> handle ,
306
306
io_end );
@@ -314,7 +314,7 @@ int ext4_put_io_end(ext4_io_end_t *io_end)
314
314
315
315
ext4_io_end_t * ext4_get_io_end (ext4_io_end_t * io_end )
316
316
{
317
- atomic_inc (& io_end -> count );
317
+ refcount_inc (& io_end -> count );
318
318
return io_end ;
319
319
}
320
320
You can’t perform that action at this time.
0 commit comments