lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240226133038.00006e23@Huawei.com>
Date: Mon, 26 Feb 2024 13:30:38 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: John Groves <John@...ves.net>
CC: John Groves <jgroves@...ron.com>, Jonathan Corbet <corbet@....net>, "Dan
 Williams" <dan.j.williams@...el.com>, Vishal Verma
	<vishal.l.verma@...el.com>, Dave Jiang <dave.jiang@...el.com>, "Alexander
 Viro" <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, "Jan
 Kara" <jack@...e.cz>, Matthew Wilcox <willy@...radead.org>,
	<linux-cxl@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
	<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<nvdimm@...ts.linux.dev>, <john@...alactic.com>, Dave Chinner
	<david@...morbit.com>, Christoph Hellwig <hch@...radead.org>,
	<dave.hansen@...ux.intel.com>, <gregory.price@...verge.com>
Subject: Re: [RFC PATCH 13/20] famfs: Add iomap_ops

On Fri, 23 Feb 2024 11:41:57 -0600
John Groves <John@...ves.net> wrote:

> This commit introduces the famfs iomap_ops. When either
> dax_iomap_fault() or dax_iomap_rw() is called, we get a callback
> via our iomap_begin() handler. The question being asked is
> "please resolve (file, offset) to (daxdev, offset)". The function
> famfs_meta_to_dax_offset() does this.
> 
> The per-file metadata is just an extent list to the
> backing dax dev.  The order of this resolution is O(N) for N
> extents. Note with the current user space, files usually have
> only one extent.
> 
> Signed-off-by: John Groves <john@...ves.net>

> ---
>  fs/famfs/famfs_file.c | 245 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 245 insertions(+)
>  create mode 100644 fs/famfs/famfs_file.c
> 
> diff --git a/fs/famfs/famfs_file.c b/fs/famfs/famfs_file.c
> new file mode 100644
> index 000000000000..fc667d5f7be8
> --- /dev/null
> +++ b/fs/famfs/famfs_file.c
> @@ -0,0 +1,245 @@

> +static int
> +famfs_meta_to_dax_offset(
> +	struct inode *inode,
> +	struct iomap *iomap,
> +	loff_t        offset,
> +	loff_t        len,
> +	unsigned int  flags)
> +{
> +	struct famfs_file_meta *meta = (struct famfs_file_meta *)inode->i_private;

i_private is void * so no need for explicit cast (C spec says this is always fine without)


> +
> +/**
> + * famfs_iomap_begin()
> + *
> + * This function is pretty simple because files are
> + * * never partially allocated
> + * * never have holes (never sparse)
> + * * never "allocate on write"
> + */
> +static int
> +famfs_iomap_begin(
> +	struct inode	       *inode,
> +	loff_t			offset,
> +	loff_t			length,
> +	unsigned int		flags,
> +	struct iomap	       *iomap,
> +	struct iomap	       *srcmap)
> +{
> +	struct famfs_file_meta *meta = inode->i_private;
> +	size_t size;
> +	int rc;
> +
> +	size = i_size_read(inode);
> +
> +	WARN_ON(size != meta->file_size);
> +
> +	rc = famfs_meta_to_dax_offset(inode, iomap, offset, length, flags);
> +
> +	return rc;
	return famfs_meta_...

> +}


> +static vm_fault_t
> +famfs_filemap_map_pages(
> +	struct vm_fault	       *vmf,
> +	pgoff_t			start_pgoff,
> +	pgoff_t			end_pgoff)
> +{
> +	vm_fault_t ret;
> +
> +	ret = filemap_map_pages(vmf, start_pgoff, end_pgoff);
> +	return ret;
	return filename_map_pages()....

> +}
> +
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ