From patchwork Wed Mar 3 18:54:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jim owens X-Patchwork-Id: 83410 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o23It54O003544 for ; Wed, 3 Mar 2010 18:55:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752146Ab0CCSzE (ORCPT ); Wed, 3 Mar 2010 13:55:04 -0500 Received: from mail-iw0-f182.google.com ([209.85.223.182]:33638 "EHLO mail-iw0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343Ab0CCSzB (ORCPT ); Wed, 3 Mar 2010 13:55:01 -0500 Received: by iwn12 with SMTP id 12so1488185iwn.21 for ; Wed, 03 Mar 2010 10:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=h6kUqbh8yIkMWJqxv3BLpTq8LBKhgavwhliKvxq01WM=; b=hEn854nfFgOelGwGSGWyf/n0FLuMxQfzhcaFGdV0XednOCv+m22UWbia9h30R1+C0w GPr1G0zoC6nxtYQVBJ7VTq9HVGvc5IroB8pQKViR5EQ8I+7uBu+DPHCrY+OltQRBThTD wYAntpDsEcn9+nzyvWFqxB8ap6Kq/vuF6nrTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=xceQFuigT2IQp+tQ/scA90yscJBbK9bmvjBt3FMux7gYKHkqLAF29D0qaVLrHoSytZ DHMqOmiSLQbcbGTQLAF21Qd5yvW0KYZnRWf7n5v3tLltVQsbOSku5HJ7VNBvIp+xnSi+ pk3SOXarM9cKkLsHglHb+XTLI9F1dC0CwTdFc= Received: by 10.231.146.4 with SMTP id f4mr285120ibv.21.1267642500541; Wed, 03 Mar 2010 10:55:00 -0800 (PST) Received: from ?192.168.0.99? (c-24-147-40-65.hsd1.nh.comcast.net [24.147.40.65]) by mx.google.com with ESMTPS id cm31sm198720ibb.20.2010.03.03.10.54.59 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Mar 2010 10:55:00 -0800 (PST) Message-ID: <4B8EB082.5090004@gmail.com> Date: Wed, 03 Mar 2010 13:54:58 -0500 From: jim owens User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: linux-btrfs Subject: [PATCH dio.c V2 2/6] Btrfs: change size_t to u32 in dio.c for 32-bit compile. Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Mar 2010 18:55:05 +0000 (UTC) diff --git a/fs/btrfs/dio.c b/fs/btrfs/dio.c index 84277a9..97ab77f 100644 --- a/fs/btrfs/dio.c +++ b/fs/btrfs/dio.c @@ -1487,8 +1487,8 @@ fail: static int btrfs_dio_inline_read(struct btrfs_diocb *diocb, u64 *data_len) { int err; - size_t size; - size_t extent_offset; + u32 size; + u32 extent_offset; u64 extent_start; u64 objectid = diocb->inode->i_ino; struct btrfs_root *root = BTRFS_I(diocb->inode)->root; @@ -1532,7 +1532,7 @@ static int btrfs_dio_inline_read(struct btrfs_diocb *diocb, u64 *data_len) size = btrfs_file_extent_inline_len(leaf, item); if (diocb->start < extent_start) { printk(KERN_ERR "btrfs directIO inline range mismatch ino %lu" - " fpos %lld found start %lld size %ld\n", + " fpos %lld found start %lld size %d\n", diocb->inode->i_ino, diocb->start, extent_start, size); err = -EDOM; goto fail; @@ -1672,7 +1672,7 @@ static int btrfs_dio_read_csum(struct btrfs_dio_extcb *extcb) } while (len) { - size_t csum_len = extcb->diocb->blocksize; + u32 csum_len = extcb->diocb->blocksize; /* each checksum block is a filesystem block and on the * same device, but user memory can be 512 byte aligned @@ -1681,11 +1681,11 @@ static int btrfs_dio_read_csum(struct btrfs_dio_extcb *extcb) csum = ~(u32)0; while (csum_len) { char *in; - size_t cl; + u32 cl; if (ivec.bv_len == 0) btrfs_dio_get_next_in(&ivec, extcb); - cl = min_t(size_t, ivec.bv_len, csum_len); + cl = min_t(u32, ivec.bv_len, csum_len); in = kmap_atomic(ivec.bv_page, KM_USER0); csum = btrfs_csum_data(root, in + ivec.bv_offset, csum, cl); @@ -1890,11 +1890,11 @@ static int btrfs_dio_read_retry(struct btrfs_dio_extcb *extcb) struct bio_vec *retry = extcb->retry_bio->bi_io_vec; char *new; u32 csum = ~0; - size_t csum_len = extcb->retry_len; + u32 csum_len = extcb->retry_len; /* blocksize can exceed page size */ while (csum_len) { - size_t cl = min_t(size_t, retry->bv_len, csum_len); + u32 cl = min_t(u32, retry->bv_len, csum_len); new = kmap_atomic(retry->bv_page, KM_USER0); csum = btrfs_csum_data(root, new, csum, cl); kunmap_atomic(new, KM_USER0); @@ -1912,8 +1912,8 @@ static int btrfs_dio_read_retry(struct btrfs_dio_extcb *extcb) if (!extcb->compressed) { struct bio_vec *retry = extcb->retry_bio->bi_io_vec; struct bio_vec bad; - size_t bad_len = min(extcb->retry_len, extcb->diocb->blocksize); - size_t offset; + u32 bad_len = min(extcb->retry_len, extcb->diocb->blocksize); + u32 offset; /* user file position can start inside logical block */ offset = extcb->retry_start & (extcb->diocb->blocksize-1); @@ -1922,13 +1922,13 @@ static int btrfs_dio_read_retry(struct btrfs_dio_extcb *extcb) bad.bv_len = 0; while (bad_len) { - size_t cl; + u32 cl; char *new; char *out; if (bad.bv_len == 0) btrfs_dio_get_next_in(&bad, extcb); - cl = min_t(size_t, bad_len, + cl = min_t(u32, bad_len, min(bad.bv_len, retry->bv_len)); new = kmap_atomic(retry->bv_page, KM_USER0); out = kmap_atomic(bad.bv_page, KM_USER1);