From patchwork Wed Jun 8 20:49:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mchristi@redhat.com X-Patchwork-Id: 632493 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rQ0tl17Dpz9sDX for ; Thu, 9 Jun 2016 06:50:07 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425382AbcFHUuD (ORCPT ); Wed, 8 Jun 2016 16:50:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53380 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425254AbcFHUtq (ORCPT ); Wed, 8 Jun 2016 16:49:46 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C57CE37E64; Wed, 8 Jun 2016 20:49:45 +0000 (UTC) Received: from rh2.redhat.com (vpn-61-23.rdu2.redhat.com [10.10.61.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u58KnicS014353; Wed, 8 Jun 2016 16:49:45 -0400 From: mchristi@redhat.com To: linux-ext4@vger.kernel.org, linux-block@vger.kernel.org Cc: Mike Christie Subject: [PATCH 1/2] ext4: use bio op helprs in ext4 crypto code Date: Wed, 8 Jun 2016 15:49:40 -0500 Message-Id: <1465418981-7360-2-git-send-email-mchristi@redhat.com> In-Reply-To: <1465418981-7360-1-git-send-email-mchristi@redhat.com> References: <1465418981-7360-1-git-send-email-mchristi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 08 Jun 2016 20:49:45 +0000 (UTC) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Mike Christie This was missed from my last patchset. This patch has ext4 crypto code use the bio op helper to set the operation. The operation (discard, write, writesame, etc) is now defined seperately from the other REQ bits. They still share the bi_rw field to save space, so we use these helpers so modules do not have to worry about setting/overwriting info. Jens, I am not sure how you handle patches on top of patches in the next branches. If you merge patches that fix issues in previous patches in next, then this patch could be part of commit 95fe6c1a209ef89d9f94dd04a0ad72be1487d5d5 Author: Mike Christie Date: Sun Jun 5 14:31:48 2016 -0500 block, fs, mm, drivers: use bio set/get op accessors Signed-off-by: Mike Christie --- fs/ext4/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c index 811bd5d..d3fa47c 100644 --- a/fs/ext4/crypto.c +++ b/fs/ext4/crypto.c @@ -428,7 +428,7 @@ int ext4_encrypted_zeroout(struct inode *inode, ext4_lblk_t lblk, bio->bi_bdev = inode->i_sb->s_bdev; bio->bi_iter.bi_sector = pblk << (inode->i_sb->s_blocksize_bits - 9); - bio->bi_rw = WRITE; + bio_set_op_attrs(bio, REQ_OP_WRITE, 0); ret = bio_add_page(bio, ciphertext_page, inode->i_sb->s_blocksize, 0); if (ret != inode->i_sb->s_blocksize) {