From: Dave Chinner <david@fromorbit.com>
To: Allison Henderson <allison.henderson@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/9] xfs: Remove all strlen in all xfs_attr_* functions for attr names.
Date: Tue, 16 Apr 2019 07:18:51 +1000 [thread overview]
Message-ID: <20190415211851.GF29573@dread.disaster.area> (raw)
In-Reply-To: <c2ef788f-223c-a31d-566b-f3c185ff0a06@oracle.com>
On Mon, Apr 15, 2019 at 01:08:50PM -0700, Allison Henderson wrote:
> On 4/14/19 4:02 PM, Dave Chinner wrote:
> > On Fri, Apr 12, 2019 at 03:50:28PM -0700, Allison Henderson wrote:
> > > This helps to pre-simplify the extra handling of the null terminator in
> > > delayed operations which use memcpy rather than strlen. Later
> > > when we introduce parent pointers, attribute names will become binary,
> > > so strlen will not work at all. Removing uses of strlen now will
> > > help reduce complexities later
> > >
> > > Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
> > > Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Hmmm. If we are going to pass name/namelen pairs around everywhere,
> > can we convert these to a struct xfs_name?
> >
> > I also wonder where we should convert the name/namelen pairs in the
> > attr args struct to an xfs_name, too, then we can just do:
> >
> > args->name = *name;
> >
> > to copy in the string pointer and the name length in one go.
> >
> > And we might even be able to put the attribute flags (e.g.
> > ATTR_ROOT) in the name.type field, and get rid of that parameter
> > being passed around, too...
> >
> > Cheers,
> >
> > Dave.
>
> I think a new struct xfs_name is reasonable. Or maybe a general purpose
> xfs_array? The value/valuelen parameters have a similar relation that could
> make use of that too. How would people feel about something like this:
>
> struct xfs_array {
> unsigned char *bytes;
> size_t len;
> }
>
> struct xfs_attribute {
> struct xfs_array name;
> int flags;
> }
Hmmm. I think that's overkill - we really don't need that much
abstraction and it makes the code more complex rather than
simplifies it. i.e. args->name.name.bytes isn't really a
simplification...
Also the above means we have to discard the const part of the names
we are passed because this construction doesn't appear to be
intended for read only strings. i.e.:
> We could add the value member in here too.
Which is something that isn't const. :)
> It tends to get passed around
> just as much with the exception of attr remove operations which only need
> the name. I think changing the actual members of xfs_da_args should be
> another patch though, since that's a bigger change that affects a wider
> scope of code. I can look into it though.
I don't think we want anything more complex or to extent it to
include other parts of the attr API - that just means we have a
special snowflake for the API rather than a generic way of encoding
a name string across all the internal interfaces that space a name/len
pair...
Really, I was just suggesting using the struct xfs_name because
it already exists and encodes/documents exactly what we are passing
here, hence getting rid of some of the mess around passing the attr
names around.
> Also, do I still keep the old reviewed-by on the patch if the patch is still
> going through changes? I have a few signed-off patches in the parent
> pointer set that have changed quite a bit since we've started too.
If the changes are significant, then it needs review again and so
you should drop it.
But I'd do the name/len -> xfsname conversion as a separate patch,
so this patch doesn't need changing.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-04-15 21:18 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 22:50 [PATCH 0/9] xfs: Delayed Attributes Allison Henderson
2019-04-12 22:50 ` [PATCH 1/9] xfs: Remove all strlen in all xfs_attr_* functions for attr names Allison Henderson
2019-04-14 23:02 ` Dave Chinner
2019-04-15 20:08 ` Allison Henderson
2019-04-15 21:18 ` Dave Chinner [this message]
2019-04-16 1:33 ` Allison Henderson
2019-04-17 15:42 ` Brian Foster
2019-04-12 22:50 ` [PATCH 2/9] xfs: Hold inode locks in xfs_ialloc Allison Henderson
2019-04-17 15:44 ` Brian Foster
2019-04-17 17:35 ` Allison Henderson
2019-04-12 22:50 ` [PATCH 3/9] xfs: Add trans toggle to attr routines Allison Henderson
2019-04-18 15:27 ` Brian Foster
2019-04-18 21:23 ` Allison Henderson
2019-04-12 22:50 ` [PATCH 4/9] xfs: Set up infastructure for deferred attribute operations Allison Henderson
2019-04-18 15:48 ` Brian Foster
2019-04-18 21:27 ` Allison Henderson
2019-04-22 11:00 ` Brian Foster
2019-04-22 22:00 ` Allison Henderson
2019-04-12 22:50 ` [PATCH 5/9] xfs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred Allison Henderson
2019-04-18 15:49 ` Brian Foster
2019-04-18 21:28 ` Allison Henderson
2019-04-22 11:01 ` Brian Foster
2019-04-22 22:01 ` Allison Henderson
2019-04-23 13:00 ` Brian Foster
2019-04-24 2:24 ` Allison Henderson
2019-04-12 22:50 ` [PATCH 6/9] xfs: Add xfs_has_attr and subroutines Allison Henderson
2019-04-15 2:46 ` Su Yue
2019-04-15 20:13 ` Allison Henderson
2019-04-22 13:00 ` Brian Foster
2019-04-22 22:01 ` Allison Henderson
2019-04-12 22:50 ` [PATCH 7/9] xfs: Add attr context to log item Allison Henderson
2019-04-15 22:50 ` Darrick J. Wong
2019-04-16 2:30 ` Allison Henderson
2019-04-16 3:21 ` Allison Henderson
2019-04-22 13:03 ` Brian Foster
2019-04-22 22:01 ` Allison Henderson
2019-04-23 13:20 ` Brian Foster
2019-04-24 2:24 ` Allison Henderson
2019-04-24 4:10 ` Darrick J. Wong
2019-04-24 12:17 ` Brian Foster
2019-04-24 15:25 ` Darrick J. Wong
2019-04-24 16:57 ` Brian Foster
2019-04-12 22:50 ` [PATCH 8/9] xfs: Roll delayed attr operations by returning EAGAIN Allison Henderson
2019-04-15 23:31 ` Darrick J. Wong
2019-04-16 19:54 ` Allison Henderson
2019-04-23 14:19 ` Brian Foster
2019-04-24 2:24 ` Allison Henderson
2019-04-12 22:50 ` [PATCH 9/9] xfs: Remove roll_trans boolean Allison Henderson
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=20190415211851.GF29573@dread.disaster.area \
--to=david@fromorbit.com \
--cc=allison.henderson@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.