All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: "misono.tomohiro@fujitsu.com" <misono.tomohiro@fujitsu.com>
Cc: virtio-fs-list <virtio-fs@redhat.com>
Subject: Re: [Virtio-fs] [PATCH] virtiofsd: Fix xattr operations
Date: Tue, 14 Jan 2020 07:55:07 -0500	[thread overview]
Message-ID: <20200114125507.GA23014@redhat.com> (raw)
In-Reply-To: <OSBPR01MB4582FF3E5050F4D4488F4DECE5340@OSBPR01MB4582.jpnprd01.prod.outlook.com>

On Tue, Jan 14, 2020 at 01:17:37AM +0000, misono.tomohiro@fujitsu.com wrote:
> > On Mon, Jan 13, 2020 at 7:42 PM Vivek Goyal <vgoyal@redhat.com> wrote:
> > >
> > > On Fri, Jan 10, 2020 at 10:07:22AM +0900, Misono Tomohiro wrote:
> > >
> > > [..]
> > > > --- a/tools/virtiofsd/passthrough_ll.c
> > > > +++ b/tools/virtiofsd/passthrough_ll.c
> > > > @@ -133,6 +133,7 @@ struct lo_inode {
> > > >      GHashTable *posix_locks; /* protected by lo_inode->plock_mutex
> > > > */
> > > >
> > > >      bool is_symlink;
> > > > +    bool is_regular;
> > > >  };
> > > >
> > > >  struct lo_cred {
> > > > @@ -1038,6 +1039,7 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t parent, const char *name,
> > > >          }
> > > >
> > > >          inode->is_symlink = S_ISLNK(e->attr.st_mode);
> > > > +        inode->is_regular = S_ISREG(e->attr.st_mode) +
> > > > + S_ISDIR(e->attr.st_mode);
> > >
> > > How about having two variables. One for regular files and one for
> > > directories. Say ->is_regular and ->is_dir.  That way if there are
> > > other users later, these can cleary differentiate between regular
> > > files and directories.
> 
> Thanks for the comments
> Maybe we should just hold st_mode in lo_inode? I'm fine with either approach and will update.

Caching st_mode (only file type and not mode) sounds good to me. That's
even more generic and more usable for future use cases.

Thanks
Vivek


      parent reply	other threads:[~2020-01-14 12:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  1:07 [Virtio-fs] [PATCH] virtiofsd: Fix xattr operations Misono Tomohiro
2020-01-10 16:13 ` Vivek Goyal
2020-01-10 20:00   ` Vivek Goyal
2020-01-13 18:38 ` Vivek Goyal
2020-01-13 19:36   ` Miklos Szeredi
2020-01-14  1:17     ` misono.tomohiro
2020-01-14  7:49       ` Miklos Szeredi
2020-01-14 11:34         ` misono.tomohiro
2020-01-14 12:55       ` Vivek Goyal [this message]

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=20200114125507.GA23014@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=misono.tomohiro@fujitsu.com \
    --cc=virtio-fs@redhat.com \
    /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.