linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Chuck Lever <cel@kernel.org>
Cc: viro@zeniv.linux.org.uk, hughd@google.com,
	akpm@linux-foundation.org, Chuck Lever <chuck.lever@oracle.com>,
	jlayton@redhat.com, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] libfs: Add directory operations for stable offsets
Date: Wed, 28 Jun 2023 11:27:52 +0200	[thread overview]
Message-ID: <20230628-geldentwertung-weggehen-97e784bde4f4@brauner> (raw)
In-Reply-To: <168789918896.157531.14644838088821804546.stgit@manet.1015granger.net>

On Tue, Jun 27, 2023 at 04:53:09PM -0400, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> Create a vector of directory operations in fs/libfs.c that handles
> directory seeks and readdir via stable offsets instead of the
> current cursor-based mechanism.
> 
> For the moment these are unused.
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---

Could we just drop the "stable_" prefix and just have:

// internal helpers
offset_dir_emit()
offset_get()
offset_set()
offset_dir_llseek()
find_next_offset()
I'd also collapse offset_iterate_dir() into offset_readdir().

// exported and published helpers
simple_offset_init()
simple_offset_add()
simple_offset_rename_exchange()
simple_offset_destroy()

struct offset_ctx *(*get_offset)(struct inode *inode);

const struct file_operations simple_offset_dir_operations;

>  fs/libfs.c         |  252 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/fs.h |   19 ++++
>  2 files changed, 271 insertions(+)
> 
> diff --git a/fs/libfs.c b/fs/libfs.c
> index 89cf614a3271..9940dce049e6 100644
> --- a/fs/libfs.c
> +++ b/fs/libfs.c
> @@ -239,6 +239,258 @@ const struct inode_operations simple_dir_inode_operations = {
>  };
>  EXPORT_SYMBOL(simple_dir_inode_operations);
>  
> +static struct stable_offset_ctx *stable_ctx_get(struct inode *inode)
> +{
> +	return inode->i_op->get_so_ctx(inode);
> +}

I would suggest to get rid of this helper. It just needlessly hides that
all we do is inode->i_op->().


  reply	other threads:[~2023-06-28  9:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 20:53 [PATCH v5 0/3] shmemfs stable directory offsets Chuck Lever
2023-06-27 20:53 ` [PATCH v5 1/3] libfs: Add directory operations for stable offsets Chuck Lever
2023-06-28  9:27   ` Christian Brauner [this message]
2023-06-28 14:27     ` Chuck Lever III
2023-06-27 20:53 ` [PATCH v5 2/3] shmem: Refactor shmem_symlink() Chuck Lever
2023-06-27 20:53 ` [PATCH v5 3/3] shmem: stable directory offsets Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230628-geldentwertung-weggehen-97e784bde4f4@brauner \
    --to=brauner@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=hughd@google.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox