Skip to content

Commit

Permalink
dm: change "unsigned" to "unsigned int"
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
  • Loading branch information
mauelsha authored and Mike Snitzer committed Feb 14, 2023
1 parent 238d991 commit 86a3238
Show file tree
Hide file tree
Showing 82 changed files with 1,016 additions and 1,016 deletions.
10 changes: 5 additions & 5 deletions drivers/md/dm-bio-prison-v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,14 @@ EXPORT_SYMBOL_GPL(dm_cell_promote_or_release);

struct dm_deferred_entry {
struct dm_deferred_set *ds;
unsigned count;
unsigned int count;
struct list_head work_items;
};

struct dm_deferred_set {
spinlock_t lock;
unsigned current_entry;
unsigned sweeper;
unsigned int current_entry;
unsigned int sweeper;
struct dm_deferred_entry entries[DEFERRED_SET_SIZE];
};

Expand Down Expand Up @@ -339,7 +339,7 @@ struct dm_deferred_entry *dm_deferred_entry_inc(struct dm_deferred_set *ds)
}
EXPORT_SYMBOL_GPL(dm_deferred_entry_inc);

static unsigned ds_next(unsigned index)
static unsigned int ds_next(unsigned int index)
{
return (index + 1) % DEFERRED_SET_SIZE;
}
Expand Down Expand Up @@ -374,7 +374,7 @@ EXPORT_SYMBOL_GPL(dm_deferred_entry_dec);
int dm_deferred_set_add_work(struct dm_deferred_set *ds, struct list_head *work)
{
int r = 1;
unsigned next_entry;
unsigned int next_entry;

spin_lock_irq(&ds->lock);
if ((ds->sweeper == ds->current_entry) &&
Expand Down
12 changes: 6 additions & 6 deletions drivers/md/dm-bio-prison-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static bool __find_or_insert(struct dm_bio_prison_v2 *prison,

static bool __get(struct dm_bio_prison_v2 *prison,
struct dm_cell_key_v2 *key,
unsigned lock_level,
unsigned int lock_level,
struct bio *inmate,
struct dm_bio_prison_cell_v2 *cell_prealloc,
struct dm_bio_prison_cell_v2 **cell)
Expand All @@ -172,7 +172,7 @@ static bool __get(struct dm_bio_prison_v2 *prison,

bool dm_cell_get_v2(struct dm_bio_prison_v2 *prison,
struct dm_cell_key_v2 *key,
unsigned lock_level,
unsigned int lock_level,
struct bio *inmate,
struct dm_bio_prison_cell_v2 *cell_prealloc,
struct dm_bio_prison_cell_v2 **cell_result)
Expand Down Expand Up @@ -225,7 +225,7 @@ EXPORT_SYMBOL_GPL(dm_cell_put_v2);

static int __lock(struct dm_bio_prison_v2 *prison,
struct dm_cell_key_v2 *key,
unsigned lock_level,
unsigned int lock_level,
struct dm_bio_prison_cell_v2 *cell_prealloc,
struct dm_bio_prison_cell_v2 **cell_result)
{
Expand Down Expand Up @@ -256,7 +256,7 @@ static int __lock(struct dm_bio_prison_v2 *prison,

int dm_cell_lock_v2(struct dm_bio_prison_v2 *prison,
struct dm_cell_key_v2 *key,
unsigned lock_level,
unsigned int lock_level,
struct dm_bio_prison_cell_v2 *cell_prealloc,
struct dm_bio_prison_cell_v2 **cell_result)
{
Expand Down Expand Up @@ -292,7 +292,7 @@ EXPORT_SYMBOL_GPL(dm_cell_quiesce_v2);

static int __promote(struct dm_bio_prison_v2 *prison,
struct dm_bio_prison_cell_v2 *cell,
unsigned new_lock_level)
unsigned int new_lock_level)
{
if (!cell->exclusive_lock)
return -EINVAL;
Expand All @@ -303,7 +303,7 @@ static int __promote(struct dm_bio_prison_v2 *prison,

int dm_cell_lock_promote_v2(struct dm_bio_prison_v2 *prison,
struct dm_bio_prison_cell_v2 *cell,
unsigned new_lock_level)
unsigned int new_lock_level)
{
int r;

Expand Down
10 changes: 5 additions & 5 deletions drivers/md/dm-bio-prison-v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ struct dm_cell_key_v2 {
struct dm_bio_prison_cell_v2 {
// FIXME: pack these
bool exclusive_lock;
unsigned exclusive_level;
unsigned shared_count;
unsigned int exclusive_level;
unsigned int shared_count;
struct work_struct *quiesce_continuation;

struct rb_node node;
Expand Down Expand Up @@ -87,7 +87,7 @@ void dm_bio_prison_free_cell_v2(struct dm_bio_prison_v2 *prison,
*/
bool dm_cell_get_v2(struct dm_bio_prison_v2 *prison,
struct dm_cell_key_v2 *key,
unsigned lock_level,
unsigned int lock_level,
struct bio *inmate,
struct dm_bio_prison_cell_v2 *cell_prealloc,
struct dm_bio_prison_cell_v2 **cell_result);
Expand Down Expand Up @@ -115,7 +115,7 @@ bool dm_cell_put_v2(struct dm_bio_prison_v2 *prison,
*/
int dm_cell_lock_v2(struct dm_bio_prison_v2 *prison,
struct dm_cell_key_v2 *key,
unsigned lock_level,
unsigned int lock_level,
struct dm_bio_prison_cell_v2 *cell_prealloc,
struct dm_bio_prison_cell_v2 **cell_result);

Expand All @@ -133,7 +133,7 @@ void dm_cell_quiesce_v2(struct dm_bio_prison_v2 *prison,
*/
int dm_cell_lock_promote_v2(struct dm_bio_prison_v2 *prison,
struct dm_bio_prison_cell_v2 *cell,
unsigned new_lock_level);
unsigned int new_lock_level);

/*
* Adds any held bios to the bio list.
Expand Down
58 changes: 29 additions & 29 deletions drivers/md/dm-bufio.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct dm_bufio_client {
unsigned long n_buffers[LIST_SIZE];

struct block_device *bdev;
unsigned block_size;
unsigned int block_size;
s8 sectors_per_block_bits;
void (*alloc_callback)(struct dm_buffer *);
void (*write_callback)(struct dm_buffer *);
Expand All @@ -99,9 +99,9 @@ struct dm_bufio_client {
struct dm_io_client *dm_io;

struct list_head reserved_buffers;
unsigned need_reserved_buffers;
unsigned int need_reserved_buffers;

unsigned minimum_buffers;
unsigned int minimum_buffers;

struct rb_root buffer_tree;
wait_queue_head_t free_buffer_wait;
Expand Down Expand Up @@ -146,14 +146,14 @@ struct dm_buffer {
unsigned char list_mode; /* LIST_* */
blk_status_t read_error;
blk_status_t write_error;
unsigned accessed;
unsigned hold_count;
unsigned int accessed;
unsigned int hold_count;
unsigned long state;
unsigned long last_accessed;
unsigned dirty_start;
unsigned dirty_end;
unsigned write_start;
unsigned write_end;
unsigned int dirty_start;
unsigned int dirty_end;
unsigned int write_start;
unsigned int write_end;
struct dm_bufio_client *c;
struct list_head write_list;
void (*end_io)(struct dm_buffer *, blk_status_t);
Expand Down Expand Up @@ -221,7 +221,7 @@ static unsigned long global_num = 0;
/*
* Buffers are freed after this timeout
*/
static unsigned dm_bufio_max_age = DM_BUFIO_DEFAULT_AGE_SECS;
static unsigned int dm_bufio_max_age = DM_BUFIO_DEFAULT_AGE_SECS;
static unsigned long dm_bufio_retain_bytes = DM_BUFIO_DEFAULT_RETAIN_BYTES;

static unsigned long dm_bufio_peak_allocated;
Expand Down Expand Up @@ -439,7 +439,7 @@ static void *alloc_buffer_data(struct dm_bufio_client *c, gfp_t gfp_mask,
* as if GFP_NOIO was specified.
*/
if (gfp_mask & __GFP_NORETRY) {
unsigned noio_flag = memalloc_noio_save();
unsigned int noio_flag = memalloc_noio_save();
void *ptr = __vmalloc(c->block_size, gfp_mask);

memalloc_noio_restore(noio_flag);
Expand Down Expand Up @@ -592,7 +592,7 @@ static void dmio_complete(unsigned long error, void *context)
}

static void use_dmio(struct dm_buffer *b, enum req_op op, sector_t sector,
unsigned n_sectors, unsigned offset)
unsigned int n_sectors, unsigned int offset)
{
int r;
struct dm_io_request io_req = {
Expand Down Expand Up @@ -630,11 +630,11 @@ static void bio_complete(struct bio *bio)
}

static void use_bio(struct dm_buffer *b, enum req_op op, sector_t sector,
unsigned n_sectors, unsigned offset)
unsigned int n_sectors, unsigned int offset)
{
struct bio *bio;
char *ptr;
unsigned vec_size, len;
unsigned int vec_size, len;

vec_size = b->c->block_size >> PAGE_SHIFT;
if (unlikely(b->c->sectors_per_block_bits < PAGE_SHIFT - SECTOR_SHIFT))
Expand All @@ -655,7 +655,7 @@ static void use_bio(struct dm_buffer *b, enum req_op op, sector_t sector,
len = n_sectors << SECTOR_SHIFT;

do {
unsigned this_step = min((unsigned)(PAGE_SIZE - offset_in_page(ptr)), len);
unsigned int this_step = min((unsigned int)(PAGE_SIZE - offset_in_page(ptr)), len);
if (!bio_add_page(bio, virt_to_page(ptr), this_step,
offset_in_page(ptr))) {
bio_put(bio);
Expand Down Expand Up @@ -685,9 +685,9 @@ static inline sector_t block_to_sector(struct dm_bufio_client *c, sector_t block
static void submit_io(struct dm_buffer *b, enum req_op op,
void (*end_io)(struct dm_buffer *, blk_status_t))
{
unsigned n_sectors;
unsigned int n_sectors;
sector_t sector;
unsigned offset, end;
unsigned int offset, end;

b->end_io = end_io;

Expand Down Expand Up @@ -1157,7 +1157,7 @@ void *dm_bufio_new(struct dm_bufio_client *c, sector_t block,
EXPORT_SYMBOL_GPL(dm_bufio_new);

void dm_bufio_prefetch(struct dm_bufio_client *c,
sector_t block, unsigned n_blocks)
sector_t block, unsigned int n_blocks)
{
struct blk_plug plug;

Expand Down Expand Up @@ -1233,7 +1233,7 @@ void dm_bufio_release(struct dm_buffer *b)
EXPORT_SYMBOL_GPL(dm_bufio_release);

void dm_bufio_mark_partial_buffer_dirty(struct dm_buffer *b,
unsigned start, unsigned end)
unsigned int start, unsigned int end)
{
struct dm_bufio_client *c = b->c;

Expand Down Expand Up @@ -1530,13 +1530,13 @@ void dm_bufio_forget_buffers(struct dm_bufio_client *c, sector_t block, sector_t
}
EXPORT_SYMBOL_GPL(dm_bufio_forget_buffers);

void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned n)
void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned int n)
{
c->minimum_buffers = n;
}
EXPORT_SYMBOL_GPL(dm_bufio_set_minimum_buffers);

unsigned dm_bufio_get_block_size(struct dm_bufio_client *c)
unsigned int dm_bufio_get_block_size(struct dm_bufio_client *c)
{
return c->block_size;
}
Expand Down Expand Up @@ -1735,15 +1735,15 @@ static unsigned long dm_bufio_shrink_count(struct shrinker *shrink, struct shrin
/*
* Create the buffering interface
*/
struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsigned block_size,
unsigned reserved_buffers, unsigned aux_size,
struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsigned int block_size,
unsigned int reserved_buffers, unsigned int aux_size,
void (*alloc_callback)(struct dm_buffer *),
void (*write_callback)(struct dm_buffer *),
unsigned int flags)
{
int r;
struct dm_bufio_client *c;
unsigned i;
unsigned int i;
char slab_name[27];

if (!block_size || block_size & ((1 << SECTOR_SHIFT) - 1)) {
Expand Down Expand Up @@ -1797,7 +1797,7 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign

if (block_size <= KMALLOC_MAX_SIZE &&
(block_size < PAGE_SIZE || !is_power_of_2(block_size))) {
unsigned align = min(1U << __ffs(block_size), (unsigned)PAGE_SIZE);
unsigned int align = min(1U << __ffs(block_size), (unsigned int)PAGE_SIZE);
snprintf(slab_name, sizeof slab_name, "dm_bufio_cache-%u", block_size);
c->slab_cache = kmem_cache_create(slab_name, block_size, align,
SLAB_RECLAIM_ACCOUNT, NULL);
Expand Down Expand Up @@ -1873,7 +1873,7 @@ EXPORT_SYMBOL_GPL(dm_bufio_client_create);
*/
void dm_bufio_client_destroy(struct dm_bufio_client *c)
{
unsigned i;
unsigned int i;

drop_buffers(c);

Expand Down Expand Up @@ -1921,9 +1921,9 @@ void dm_bufio_set_sector_offset(struct dm_bufio_client *c, sector_t start)
}
EXPORT_SYMBOL_GPL(dm_bufio_set_sector_offset);

static unsigned get_max_age_hz(void)
static unsigned int get_max_age_hz(void)
{
unsigned max_age = READ_ONCE(dm_bufio_max_age);
unsigned int max_age = READ_ONCE(dm_bufio_max_age);

if (max_age > UINT_MAX / HZ)
max_age = UINT_MAX / HZ;
Expand Down Expand Up @@ -1974,7 +1974,7 @@ static void do_global_cleanup(struct work_struct *w)
struct dm_bufio_client *locked_client = NULL;
struct dm_bufio_client *current_client;
struct dm_buffer *b;
unsigned spinlock_hold_count;
unsigned int spinlock_hold_count;
unsigned long threshold = dm_bufio_cache_size -
dm_bufio_cache_size / DM_BUFIO_LOW_WATERMARK_RATIO;
unsigned long loops = global_num * 2;
Expand Down
8 changes: 4 additions & 4 deletions drivers/md/dm-cache-background-tracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct bt_work {
};

struct background_tracker {
unsigned max_work;
unsigned int max_work;
atomic_t pending_promotes;
atomic_t pending_writebacks;
atomic_t pending_demotes;
Expand All @@ -30,7 +30,7 @@ struct background_tracker {
struct kmem_cache *work_cache;
};

struct background_tracker *btracker_create(unsigned max_work)
struct background_tracker *btracker_create(unsigned int max_work)
{
struct background_tracker *b = kmalloc(sizeof(*b), GFP_KERNEL);

Expand Down Expand Up @@ -156,13 +156,13 @@ static void update_stats(struct background_tracker *b, struct policy_work *w, in
}
}

unsigned btracker_nr_writebacks_queued(struct background_tracker *b)
unsigned int btracker_nr_writebacks_queued(struct background_tracker *b)
{
return atomic_read(&b->pending_writebacks);
}
EXPORT_SYMBOL_GPL(btracker_nr_writebacks_queued);

unsigned btracker_nr_demotions_queued(struct background_tracker *b)
unsigned int btracker_nr_demotions_queued(struct background_tracker *b)
{
return atomic_read(&b->pending_demotes);
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/md/dm-cache-background-tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct background_tracker;
* Create a new tracker, it will not be able to queue more than
* 'max_work' entries.
*/
struct background_tracker *btracker_create(unsigned max_work);
struct background_tracker *btracker_create(unsigned int max_work);

/*
* Destroy the tracker. No issued, but not complete, work should
Expand All @@ -42,8 +42,8 @@ struct background_tracker *btracker_create(unsigned max_work);
*/
void btracker_destroy(struct background_tracker *b);

unsigned btracker_nr_writebacks_queued(struct background_tracker *b);
unsigned btracker_nr_demotions_queued(struct background_tracker *b);
unsigned int btracker_nr_writebacks_queued(struct background_tracker *b);
unsigned int btracker_nr_demotions_queued(struct background_tracker *b);

/*
* Queue some work within the tracker. 'work' should point to the work
Expand Down
Loading

0 comments on commit 86a3238

Please sign in to comment.