Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334148
b: refs/heads/master
c: fe5fe90
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Oct 12, 2012
1 parent d5de7b0 commit 57f2f61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54499afbb80e44ae5511984486b4b33d6229fceb
refs/heads/master: fe5fe90639b62a75349dd1f1c74c4a984397171c
10 changes: 3 additions & 7 deletions trunk/drivers/md/dm-bufio.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,7 @@ static void __cache_size_refresh(void)
BUG_ON(!mutex_is_locked(&dm_bufio_clients_lock));
BUG_ON(dm_bufio_client_count < 0);

dm_bufio_cache_size_latch = dm_bufio_cache_size;

barrier();
dm_bufio_cache_size_latch = ACCESS_ONCE(dm_bufio_cache_size);

/*
* Use default if set to 0 and report the actual cache size used.
Expand Down Expand Up @@ -812,7 +810,7 @@ static void __get_memory_limit(struct dm_bufio_client *c,
{
unsigned long buffers;

if (dm_bufio_cache_size != dm_bufio_cache_size_latch) {
if (ACCESS_ONCE(dm_bufio_cache_size) != dm_bufio_cache_size_latch) {
mutex_lock(&dm_bufio_clients_lock);
__cache_size_refresh();
mutex_unlock(&dm_bufio_clients_lock);
Expand Down Expand Up @@ -1590,11 +1588,9 @@ EXPORT_SYMBOL_GPL(dm_bufio_client_destroy);

static void cleanup_old_buffers(void)
{
unsigned long max_age = dm_bufio_max_age;
unsigned long max_age = ACCESS_ONCE(dm_bufio_max_age);
struct dm_bufio_client *c;

barrier();

if (max_age > ULONG_MAX / HZ)
max_age = ULONG_MAX / HZ;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/md/dm-verity.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static void verity_prefetch_io(struct dm_verity *v, struct dm_verity_io *io)
verity_hash_at_level(v, io->block, i, &hash_block_start, NULL);
verity_hash_at_level(v, io->block + io->n_blocks - 1, i, &hash_block_end, NULL);
if (!i) {
unsigned cluster = *(volatile unsigned *)&dm_verity_prefetch_cluster;
unsigned cluster = ACCESS_ONCE(dm_verity_prefetch_cluster);

cluster >>= v->data_dev_block_bits;
if (unlikely(!cluster))
Expand Down

0 comments on commit 57f2f61

Please sign in to comment.