From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEE00C10DCE for ; Sun, 15 Mar 2020 17:20:18 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A036E206E9; Sun, 15 Mar 2020 17:20:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="DM+pf2ip"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="N5XrmGx6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="GRv0yGuN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A036E206E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jDWvx-0002y2-4g; Sun, 15 Mar 2020 17:20:17 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jDWvv-0002xu-7a for linux-f2fs-devel@lists.sourceforge.net; Sun, 15 Mar 2020 17:20:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CWLpPDoFHazfjx32kSjsxWwwhng2wiYDVsnBb/th+1I=; b=DM+pf2ipulTYl2DgmAUq4ELkqT qzXG5f/1BJ9aqxAhwKRQmwJQVNuargKNOtM+5P24F2KxA92C4TiHizKDHj2cpYmVSWUeBrwTLst4h 7jIKYtB0rM9EBetywoe1p9QhErSvVDE74ufl6z1n+Y+35d0nLMROdq1eISEUkgxdW2hc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CWLpPDoFHazfjx32kSjsxWwwhng2wiYDVsnBb/th+1I=; b=N5XrmGx6u8HZYTjx7lL5e6c5+i hvRKSFMJYU1BIEXEGyR7FNf99MM27/01JCWWHi5Zt5h2VfBtBlGqGhgtmFMacvohwwVgt3cpSCiBg jDyq2g28JYpxPbRkP2zf/gkxlyWGXcQ7SnFu7G4nmX7IOWpbvu8I/noOTAIvK5XWfwH8=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jDWvu-00Btsx-4K for linux-f2fs-devel@lists.sourceforge.net; Sun, 15 Mar 2020 17:20:15 +0000 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A404206E9; Sun, 15 Mar 2020 17:20:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584292808; bh=bAeTblsoxv+HFw200CM9Fo21wbK4gQ0eQ+AlWbrz0/0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GRv0yGuN17hv3d3+XX/JErNuOlQ9wEp2jXMDSSfAdKpQFimOJFZNYD4p+r7FN4mEh 5DFaGOTng+jHOnJaslTMvshAzPnWw0R85Z0mtXdrqX1rBpNsOcbSNPgEvw0G6KN5bV UK9YdrCVshpeCuEUEdP6m4SiLxIad2uylRMWyEm8= Date: Sun, 15 Mar 2020 10:20:06 -0700 From: Eric Biggers To: Satya Tangirala Message-ID: <20200315172006.GB1055@sol.localdomain> References: <20200312080253.3667-1-satyat@google.com> <20200312080253.3667-10-satyat@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200312080253.3667-10-satyat@google.com> X-Headers-End: 1jDWvu-00Btsx-4K Subject: Re: [f2fs-dev] [PATCH v8 09/11] fscrypt: add inline encryption support X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-scsi@vger.kernel.org, Kim Boojin , Kuohong Wang , Barani Muthukumaran , linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Thu, Mar 12, 2020 at 01:02:51AM -0700, Satya Tangirala wrote: > +int fscrypt_prepare_inline_crypt_key(struct fscrypt_prepared_key *prep_key, > + const u8 *raw_key, > + const struct fscrypt_info *ci) > +{ > + const struct inode *inode = ci->ci_inode; > + struct super_block *sb = inode->i_sb; > + enum blk_crypto_mode_num crypto_mode = ci->ci_mode->blk_crypto_mode; > + unsigned int blk_crypto_dun_bytes; 'blk_crypto_dun_bytes' is overly verbose. 'dun_bytes' would still be just as clear. This comment also applies to the parameter to blk_crypto_init_key(). > +/** > + * fscrypt_set_bio_crypt_ctx_bh - prepare a file contents bio for inline > + * encryption > + * @bio: a bio which will eventually be submitted to the file > + * @first_bh: the first buffer_head for which I/O will be submitted > + * @gfp_mask: memory allocation flags > + * > + * Same as fscrypt_set_bio_crypt_ctx(), except this takes a buffer_head instead > + * of an inode and block number directly. > + */ > +void fscrypt_set_bio_crypt_ctx_bh(struct bio *bio, > + const struct buffer_head *first_bh, > + gfp_t gfp_mask) > +{ > + const struct inode *inode; > + u64 first_lblk; > + > + if (bh_get_inode_and_lblk_num(first_bh, &inode, &first_lblk)) > + fscrypt_set_bio_crypt_ctx(bio, inode, first_lblk, gfp_mask); > +} > +EXPORT_SYMBOL_GPL(fscrypt_set_bio_crypt_ctx_bh); Nit: the continuation lines for the function arguments aren't aligned. - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel