]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Btrfs: Fix compile warnings on 32 bit machines
authorChris Mason <chris.mason@oracle.com>
Tue, 11 Nov 2008 14:34:41 +0000 (09:34 -0500)
committerChris Mason <chris.mason@oracle.com>
Tue, 11 Nov 2008 14:34:41 +0000 (09:34 -0500)
Simple casting here and there to fix things up.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/compression.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/zlib.c

index b582c6fd80f2413eaeb39928609c77a40611bed7..bfd1512cce0a5616796b6328d22b581e7b3e3ace 100644 (file)
@@ -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;
index 5cc0082379ce683604f9c46856fad773d6006379..54d013c3bb883eacd3528d295978b9bb80e9583e 100644 (file)
@@ -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]);
@@ -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;
@@ -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]);
@@ -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;
index 5ca9c0672374a5e6fd6b95fa7ce6a6c8cec42530..2ed2deacde902d0fd5f0ff9ca95ea3b722ef5ad5 100644 (file)
@@ -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);
@@ -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) {
index ba2527d0873466f6da944bea6a1f03370b271937..5b9f7002513c9f1f68c7ea0191a4d17b41ef29d2 100644 (file)
@@ -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;