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

Zach Brown zab at zabbo.net
Fri Feb 28 15:31:16 PST 2025


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

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

- z



More information about the ngnfs-devel mailing list