[PATCH 09/14] Add ngnfs_dir_get_handle() for using files/dirs

Valerie Aurora val at versity.com
Mon Mar 3 10:10:44 PST 2025


On Sat, Mar 1, 2025 at 12:31 AM Zach Brown <zab at zabbo.net> wrote:
>
> On Thu, Feb 27, 2025 at 03:16:18PM +0100, Valerie Aurora wrote:
> > ngnfs_dir_get_handle() returns a handle that can be used to do
> > operations on files and directories.
>
> > +int ngnfs_dir_get_handle(struct ngnfs_fs_info *nfi, u64 dir_ino, char *name, size_t name_len,
> > +                      struct ngnfs_dir_handle *hdl)
>
> Handle's an unfortunate collision with the open_by_handle() syscalls --
> let's not use that.  Similarly, descriptor presents a problem with
> expectations (having one of these does not protect the inode it
> describes).

I took "like open_by_handle()" a little too literally. :)

> Can we pull back from trying to generalize and call it what it is?  It's
> just the contents of the dirent at the name.
>
>         struct ngnfs_lookup_entry {
>                 struct ngnfs_ino_gen ig;
>                 u8 d_type;
>         };
>
> Does that look OK?
>
> Then all the methods that take u64 ino would take the ig.  (Which we
> want to do for the long term so that we can return errors if the inode
> number is deleted and re-used under a caller.)

Sounds great, thanks!

Valerie


Valerie



More information about the ngnfs-devel mailing list