Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129014
b: refs/heads/master
c: 5b050f0
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Nov 11, 2008
1 parent 3432031 commit de36c8b
Show file tree
Hide file tree
Showing 5 changed files with 13 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: 8247b41ac980d125de8aeba6f33f381056ac0ecb
refs/heads/master: 5b050f04c8ce911c5b6831305a24d70eab95e732
3 changes: 2 additions & 1 deletion trunk/fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ static noinline int end_compressed_writeback(struct inode *inode, u64 start,

while(nr_pages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min(nr_pages, ARRAY_SIZE(pages)), pages);
min_t(unsigned long,
nr_pages, ARRAY_SIZE(pages)), pages);
if (ret == 0) {
nr_pages -= 1;
index += 1;
Expand Down
11 changes: 7 additions & 4 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,8 @@ static noinline int __unlock_for_delalloc(struct inode *inode,

while(nr_pages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min(nr_pages, ARRAY_SIZE(pages)), pages);
min_t(unsigned long, nr_pages,
ARRAY_SIZE(pages)), pages);
for (i = 0; i < ret; i++) {
if (pages[i] != locked_page)
unlock_page(pages[i]);
Expand Down Expand Up @@ -1192,7 +1193,8 @@ static noinline int lock_delalloc_pages(struct inode *inode,
nrpages = end_index - index + 1;
while(nrpages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min(nrpages, ARRAY_SIZE(pages)), pages);
min_t(unsigned long,
nrpages, ARRAY_SIZE(pages)), pages);
if (ret == 0) {
ret = -EAGAIN;
goto done;
Expand Down Expand Up @@ -1346,7 +1348,8 @@ int extent_clear_unlock_delalloc(struct inode *inode,

while(nr_pages > 0) {
ret = find_get_pages_contig(inode->i_mapping, index,
min(nr_pages, ARRAY_SIZE(pages)), pages);
min_t(unsigned long,
nr_pages, ARRAY_SIZE(pages)), pages);
for (i = 0; i < ret; i++) {
if (pages[i] == locked_page) {
page_cache_release(pages[i]);
Expand Down Expand Up @@ -1896,7 +1899,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree,
int contig = 0;
int this_compressed = bio_flags & EXTENT_BIO_COMPRESSED;
int old_compressed = prev_bio_flags & EXTENT_BIO_COMPRESSED;
size_t page_size = min(size, PAGE_CACHE_SIZE);
size_t page_size = min_t(size_t, size, PAGE_CACHE_SIZE);

if (bio_ret && *bio_ret) {
bio = *bio_ret;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static int noinline insert_inline_extent(struct btrfs_trans_handle *trans,
int i = 0;
while(compressed_size > 0) {
cpage = compressed_pages[i];
cur_size = min(compressed_size,
cur_size = min_t(unsigned long, compressed_size,
PAGE_CACHE_SIZE);

kaddr = kmap(cpage);
Expand Down Expand Up @@ -3812,7 +3812,7 @@ static noinline int uncompress_inline(struct btrfs_path *path,

read_extent_buffer(leaf, tmp, ptr, inline_size);

max_size = min(PAGE_CACHE_SIZE, max_size);
max_size = min_t(unsigned long, PAGE_CACHE_SIZE, max_size);
ret = btrfs_zlib_decompress(tmp, page, extent_offset,
inline_size, max_size);
if (ret) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/btrfs/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ int btrfs_zlib_decompress_biovec(struct page **pages_in,

data_in = kmap(pages_in[page_in_index]);
workspace->inf_strm.next_in = data_in;
workspace->inf_strm.avail_in = min(srclen, PAGE_CACHE_SIZE);
workspace->inf_strm.avail_in = min_t(size_t, srclen, PAGE_CACHE_SIZE);
workspace->inf_strm.total_in = 0;

workspace->inf_strm.total_out = 0;
Expand Down

0 comments on commit de36c8b

Please sign in to comment.