linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Christian Brauner <brauner@kernel.org>
Cc: Chuck Lever <cel@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>,
	Hugh Dickins <hughd@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jeff Layton <jlayton@redhat.com>, linux-mm <linux-mm@kvack.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v5 1/3] libfs: Add directory operations for stable offsets
Date: Wed, 28 Jun 2023 14:27:38 +0000	[thread overview]
Message-ID: <0D524292-5C87-4A55-B10E-9AC394CA00B8@oracle.com> (raw)
In-Reply-To: <20230628-geldentwertung-weggehen-97e784bde4f4@brauner>



> On Jun 28, 2023, at 5:27 AM, Christian Brauner <brauner@kernel.org> wrote:
> 
> 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().

We need to keep offset_iterate_dir(). XA_STATE() works only as a
declaration, so it has to be at the top of a function.

Everything else I can do.


> // 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->().

--
Chuck Lever




  reply	other threads:[~2023-06-28 14:27 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
2023-06-28 14:27     ` Chuck Lever III [this message]
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=0D524292-5C87-4A55-B10E-9AC394CA00B8@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=cel@kernel.org \
    --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