From patchwork Wed Mar 18 08:56:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiyoshi Ueda X-Patchwork-Id: 12793 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2I8wxnk024000 for ; Wed, 18 Mar 2009 08:58:59 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id F05DD618C27; Wed, 18 Mar 2009 04:58:59 -0400 (EDT) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n2I8wvxP006029 for ; Wed, 18 Mar 2009 04:58:57 -0400 Received: from mx3.redhat.com (mx3.redhat.com [172.16.48.32]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2I8wwRR025774; Wed, 18 Mar 2009 04:58:58 -0400 Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by mx3.redhat.com (8.13.8/8.13.8) with ESMTP id n2I8ujLf032392; Wed, 18 Mar 2009 04:56:45 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.160]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id n2I8ueRm013980; Wed, 18 Mar 2009 17:56:40 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id n2I8ueM02212; Wed, 18 Mar 2009 17:56:40 +0900 (JST) Received: from mailsv.linux.bs1.fc.nec.co.jp (mailsv.linux.bs1.fc.nec.co.jp [10.34.125.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id n2I8ueMX028836; Wed, 18 Mar 2009 17:56:40 +0900 (JST) Received: from elcondor.linux.bs1.fc.nec.co.jp (elcondor.linux.bs1.fc.nec.co.jp [10.34.125.195]) by mailsv.linux.bs1.fc.nec.co.jp (Postfix) with ESMTP id 21E9CE48276; Wed, 18 Mar 2009 17:56:40 +0900 (JST) Message-ID: <49C0B747.3060802@ct.jp.nec.com> Date: Wed, 18 Mar 2009 17:56:39 +0900 From: Kiyoshi Ueda User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Alasdair Kergon References: <49C0B474.4000204@ct.jp.nec.com> In-Reply-To: <49C0B474.4000204@ct.jp.nec.com> X-RedHat-Spam-Score: 0 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Scanned-By: MIMEDefang 2.63 on 172.16.48.32 X-loop: dm-devel@redhat.com Cc: device-mapper development , martin.petersen@oracle.com, jens.axboe@oracle.com Subject: [dm-devel] [PATCH 6/8] block: add gfp_mask parameter to bio_integrity_clone() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com This patch adds gfp_mask parameter to bio_integrity_clone(). Stricter gfp_mask might be required for clone allocation. For example, request-based dm may clone bio in interrupt disabled context, so it has to use GFP_ATOMIC. Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Cc: Martin K. Petersen Cc: Jens Axboe Cc: Alasdair G Kergon --- fs/bio-integrity.c | 5 +++-- fs/bio.c | 2 +- include/linux/bio.h | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: 2.6.29-rc8/fs/bio-integrity.c =================================================================== --- 2.6.29-rc8.orig/fs/bio-integrity.c +++ 2.6.29-rc8/fs/bio-integrity.c @@ -685,19 +685,20 @@ EXPORT_SYMBOL(bio_integrity_split); * bio_integrity_clone - Callback for cloning bios with integrity metadata * @bio: New bio * @bio_src: Original bio + * @gfp_mask: Memory allocation mask * @bs: bio_set to allocate bip from * * Description: Called to allocate a bip when cloning a bio */ int bio_integrity_clone(struct bio *bio, struct bio *bio_src, - struct bio_set *bs) + gfp_t gfp_mask, struct bio_set *bs) { struct bio_integrity_payload *bip_src = bio_src->bi_integrity; struct bio_integrity_payload *bip; BUG_ON(bip_src == NULL); - bip = bio_integrity_alloc_bioset(bio, GFP_NOIO, bip_src->bip_vcnt, bs); + bip = bio_integrity_alloc_bioset(bio, gfp_mask, bip_src->bip_vcnt, bs); if (bip == NULL) return -EIO; Index: 2.6.29-rc8/fs/bio.c =================================================================== --- 2.6.29-rc8.orig/fs/bio.c +++ 2.6.29-rc8/fs/bio.c @@ -463,7 +463,7 @@ struct bio *bio_clone(struct bio *bio, g if (bio_integrity(bio)) { int ret; - ret = bio_integrity_clone(b, bio, fs_bio_set); + ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set); if (ret < 0) return NULL; Index: 2.6.29-rc8/include/linux/bio.h =================================================================== --- 2.6.29-rc8.orig/include/linux/bio.h +++ 2.6.29-rc8/include/linux/bio.h @@ -531,7 +531,8 @@ extern void bio_integrity_endio(struct b extern void bio_integrity_advance(struct bio *, unsigned int); extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); extern void bio_integrity_split(struct bio *, struct bio_pair *, int); -extern int bio_integrity_clone(struct bio *, struct bio *, struct bio_set *); +extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, + struct bio_set *); extern int bioset_integrity_create(struct bio_set *, int); extern void bioset_integrity_free(struct bio_set *); extern void bio_integrity_init_slab(void); @@ -542,7 +543,7 @@ extern void bio_integrity_init_slab(void #define bioset_integrity_create(a, b) (0) #define bio_integrity_prep(a) (0) #define bio_integrity_enabled(a) (0) -#define bio_integrity_clone(a, b, c) (0) +#define bio_integrity_clone(a, b, c, d) (0) #define bioset_integrity_free(a) do { } while (0) #define bio_integrity_free(a, b) do { } while (0) #define bio_integrity_endio(a, b) do { } while (0)