From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:38152 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbdHKKVP (ORCPT ); Fri, 11 Aug 2017 06:21:15 -0400 Date: Fri, 11 Aug 2017 12:21:13 +0200 From: Christoph Hellwig To: Mimi Zohar Cc: Christoph Hellwig , Al Viro , James Morris , linux-fsdevel@vger.kernel.org, linux-ima-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, Matthew Garrett , Jan Kara , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Steven Whitehouse , Bob Peterson , David Woodhouse , Dave Kleikamp , Ryusuke Konishi , Mark Fasheh , Joel Becker , Richard Weinberger , "Darrick J. Wong" , Hugh Dickins , Chris Mason Subject: Re: [PATCH v5 2/4] ima: use fs method to read integrity data Message-ID: <20170811102113.GC11531@lst.de> References: <1502408507-4257-1-git-send-email-zohar@linux.vnet.ibm.com> <1502408507-4257-3-git-send-email-zohar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502408507-4257-3-git-send-email-zohar@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Aug 10, 2017 at 07:41:45PM -0400, Mimi Zohar wrote: > From: Christoph Hellwig > > Add a new ->integrity_read file operation to read data for integrity > hash collection. This is defined to be equivalent to ->read_iter, > except that it will be called with the i_rwsem held exclusively. > > Signed-off-by: Christoph Hellwig Btw, most of this is yours now, feel free to take over the authorship with a little credit to me for the initial patch if you want. > Cc: Matthew Garrett I don't think that will reach Matthew anymore :) > -static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, > - size_t count, loff_t *ppos) > +static ssize_t efivarfs_file_read_iter(struct kiocb *iocb, > + struct iov_iter *iter) The efivars switch to read_iter should be a separate patch before this one. > /** > + * simple_read_iter_from_buffer - copy data from the buffer to user space > + * @iocb: struct containing the file, the current position and other info > + * @to: the user space buffer to read to > + * @from: the buffer to read from > + * @available: the size of the buffer > + * > + * The simple_read_iter_from_buffer() function reads up to @available bytes > + * from the current buffer into the user space buffer. > + * > + * On success, the current buffer offset is advanced by the number of bytes > + * read, or a negative value is returned on error. > + **/ > +ssize_t simple_read_iter_from_buffer(struct kiocb *iocb, struct iov_iter *to, > + const void *from, size_t available) The addition of simple_read_iter_from_buffer should be another separate patch, before efivars starts using it.