linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Chuck Lever <cel@kernel.org>,
	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 v4 1/3] libfs: Add directory operations for stable offsets
Date: Tue, 27 Jun 2023 10:52:20 +0200	[thread overview]
Message-ID: <20230627-drastisch-wiegt-8d2aba4e5a0d@brauner> (raw)
In-Reply-To: <ZJqFP8W1JmWZ0FHy@infradead.org>

On Mon, Jun 26, 2023 at 11:44:15PM -0700, Christoph Hellwig wrote:
> > + * @dir: parent directory to be initialized
> > + *
> > + */
> > +void stable_offset_init(struct inode *dir)
> > +{
> > +	xa_init_flags(&dir->i_doff_map, XA_FLAGS_ALLOC1);
> > +	dir->i_next_offset = 0;
> > +}
> > +EXPORT_SYMBOL(stable_offset_init);
> 
> If this is exported I'd much prefer a EXPORT_SYMBOL_GPL.  But the only
> user so far is shmfs, which can't be modular anyway, so I think we can
> drop the exports.
> 
> > --- a/include/linux/dcache.h
> > +++ b/include/linux/dcache.h
> > @@ -96,6 +96,7 @@ struct dentry {
> >  	struct super_block *d_sb;	/* The root of the dentry tree */
> >  	unsigned long d_time;		/* used by d_revalidate */
> >  	void *d_fsdata;			/* fs-specific data */
> > +	u32 d_offset;			/* directory offset in parent */
> >  
> >  	union {
> >  		struct list_head d_lru;		/* LRU list */
> > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > index 133f0640fb24..3fc2c04ed8ff 100644
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -719,6 +719,10 @@ struct inode {
> >  #endif
> >  
> >  	void			*i_private; /* fs or device private pointer */
> > +
> > +	/* simplefs stable directory offset tracking */
> > +	struct xarray		i_doff_map;
> > +	u32			i_next_offset;
> 
> We can't just increase the size of the dentry and inode for everyone
> for something that doesn't make any sense for normal file systems.
> This needs to move out into structures allocated by the file system
> and embedded into or used as the private dentry/inode data.

I agree. I prefer if this could be done on a per filesystem basis as
well. Especially since, this is currently only useful for a single
filesystem.

We've tried to be very conservative in increasing inode and dentry size
and we should continue with that.


  reply	other threads:[~2023-06-27  8:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 18:21 [PATCH v4 0/3] shmemfs stable directory offsets Chuck Lever
2023-06-26 18:21 ` [PATCH v4 1/3] libfs: Add directory operations for stable offsets Chuck Lever
2023-06-27  6:44   ` Christoph Hellwig
2023-06-27  8:52     ` Christian Brauner [this message]
2023-06-27 14:04       ` Chuck Lever III
2023-06-27 14:19         ` Jeff Layton
2023-06-26 18:21 ` [PATCH v4 2/3] shmem: Refactor shmem_symlink() Chuck Lever
2023-06-27  6:44   ` Christoph Hellwig
2023-06-26 18:21 ` [PATCH v4 3/3] shmem: stable directory offsets Chuck Lever
2023-06-27 14:06   ` Bernd Schubert
2023-06-27 14:11     ` Chuck Lever III
2023-06-27 14:48       ` Bernd Schubert

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=20230627-drastisch-wiegt-8d2aba4e5a0d@brauner \
    --to=brauner@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=hch@infradead.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