Hello, Mikhail Karpov, le mer. 07 oct. 2026 10:35:22 +0700, a ecrit: > On Mon, 5 Oct 2026 23:37:13 Samuel Thibault wrote: > > > And indeed, trivfs_S_io_map has disappeared, but netfs_S_io_map was not > > introduced. > > It is not strictly necessary to implement the netfs_S_io_map function, > because we could implement netfs_get_filemap instead, which would be called > by the netfs_S_io_map function in libnetfs.
Ah, I missed that we already have netfs_get_filemap, but > However, in our case, we need to implement netfs_S_io_map specifically > because the behavior of trivfs_S_io_map from storeio differs from > the netfs_S_io_map implementation in libnetfs. Examining the > code reveals that trivfs_S_io_map returned an error only if the > dev_get_memory_object function failed, even though memobj could be > MACH_PORT_NULL. and indeed, in the zero device case, it does return null so the caller maps null. > In the netfs_S_io_map implementation, an error is returned > if memobj is MACH_PORT_NULL. I do not know which behavior is more correct. > We can either modify the behavior of netfs_S_io_map to match trivfs_S_io_map > or simply override netfs_S_io_map in storeio. It seems safer to me to just override netfs_S_io_map for now, to avoid changing the behavior of libnetfs for all translators. > > Also, ls -l /dev/zero returns > > > > ls: reading directory '/dev/zero': Not a directory > > > > I guess it should be fixed into not showing the directory type when > > there is not partition table. > > We can override netfs_S_io_stat and return the desired mode when > netfs_root_node is accessed. We need to override this function because > modifying netfs_root_node->nn_stat.st_mode directly is not allowed, as it > leads to errors. Which errors? Samuel
