bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] libnetfs: new user callback: netfs_get_filemap()


From: Joan Lledó
Subject: [PATCH 1/3] libnetfs: new user callback: netfs_get_filemap()
Date: Sun, 12 Dec 2021 14:08:15 +0100

From: Joan Lledó <jlledom@member.fsf.org>

Provide the user with a new callback so they can implement file
mapping over file system nodes.

* libnetfs/netfs.h: Add prototype for netfs_get_filemap

* acpi/netfs_impl.c:
* console-client/trans.c:
* console/console.c:
* eth-multiplexer/netfs_impl.c:
* ftpfs/netfs.c:
* hostmux/mux.c:
* libnetfs/netfs.h:
* nfs/ops.c:
* pci-arbiter/netfs_impl.c:
* procfs/netfs.c:
* trans/fakeroot.c:
* usermux/mux.c:
        * Implement empty netfs_get_filemap()
---
 acpi/netfs_impl.c            | 10 ++++++++++
 console-client/trans.c       | 10 ++++++++++
 console/console.c            | 10 ++++++++++
 eth-multiplexer/netfs_impl.c | 10 ++++++++++
 ftpfs/netfs.c                | 11 +++++++++++
 hostmux/mux.c                | 11 +++++++++++
 libnetfs/netfs.h             |  5 +++++
 nfs/ops.c                    |  9 +++++++++
 pci-arbiter/netfs_impl.c     | 10 ++++++++++
 procfs/netfs.c               | 10 ++++++++++
 trans/fakeroot.c             | 10 ++++++++++
 usermux/mux.c                | 11 +++++++++++
 12 files changed, 117 insertions(+)

diff --git a/acpi/netfs_impl.c b/acpi/netfs_impl.c
index 38ff5e17..5f7f7d7b 100644
--- a/acpi/netfs_impl.c
+++ b/acpi/netfs_impl.c
@@ -243,6 +243,16 @@ netfs_get_dirents (struct iouser * cred, struct node * dir,
   return err;
 }
 
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 /* Lookup NAME in DIR for USER; set *NODE to the found name upon return.  If
    the name was not found, then return ENOENT.  On any error, clear *NODE.
    (*NODE, if found, should be locked, this call should unlock DIR no matter
diff --git a/console-client/trans.c b/console-client/trans.c
index 0285a234..6c88560d 100644
--- a/console-client/trans.c
+++ b/console-client/trans.c
@@ -779,6 +779,16 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
   return err;
 }
 
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 
 
 static void *
diff --git a/console/console.c b/console/console.c
index 7306b6b8..b9655830 100644
--- a/console/console.c
+++ b/console/console.c
@@ -900,6 +900,16 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
   return err;
 }
 
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 /* This should sync the entire remote filesystem.  If WAIT is set, return
    only after sync is completely finished.  */
 error_t
diff --git a/eth-multiplexer/netfs_impl.c b/eth-multiplexer/netfs_impl.c
index 040512a0..90e0a84f 100644
--- a/eth-multiplexer/netfs_impl.c
+++ b/eth-multiplexer/netfs_impl.c
@@ -274,6 +274,16 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
   return err;
 }
 
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 /* Lookup NAME in DIR for USER; set *NODE to the found name upon return.  If
    the name was not found, then return ENOENT.  On any error, clear *NODE.
    (*NODE, if found, should be locked, this call should unlock DIR no matter
diff --git a/ftpfs/netfs.c b/ftpfs/netfs.c
index b0c80db1..1a846eb2 100644
--- a/ftpfs/netfs.c
+++ b/ftpfs/netfs.c
@@ -265,6 +265,17 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
 
   return err;
 }
+
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 
 /* Lookup NAME in DIR for USER; set *NODE to the found name upon return.  If
    the name was not found, then return ENOENT.  On any error, clear *NODE.
diff --git a/hostmux/mux.c b/hostmux/mux.c
index ddca89d1..3691238c 100644
--- a/hostmux/mux.c
+++ b/hostmux/mux.c
@@ -210,6 +210,17 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
 
   return err;
 }
+
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 
 /* Host lookup.  */
 
diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h
index 38182ab7..a7f610ec 100644
--- a/libnetfs/netfs.h
+++ b/libnetfs/netfs.h
@@ -303,6 +303,11 @@ error_t netfs_get_dirents (struct iouser *cred, struct 
node *dir,
                           mach_msg_type_number_t *datacnt,
                           vm_size_t bufsize, int *amt);
 
+/* The user must define this function. Return a memory object proxy port (send
+   right) for the file contents of NP. PROT is the maximum allowable
+   access. On errors, return MACH_PORT_NULL and set errno.  */
+mach_port_t netfs_get_filemap (struct node *np, vm_prot_t prot);
+
 /* The user may define this function.  For a full description,
    see hurd/hurd_types.h.  The default response indicates a network
    store.  If the supplied buffers are not large enough, they should
diff --git a/nfs/ops.c b/nfs/ops.c
index 3599b496..3c4186bd 100644
--- a/nfs/ops.c
+++ b/nfs/ops.c
@@ -1876,6 +1876,15 @@ netfs_get_dirents (struct iouser *cred, struct node *np,
   return 0;
 }
 
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
 
 /* Implement the netfs_attempt_mksymlink callback as described in
    <hurd/netfs.h>.  */
diff --git a/pci-arbiter/netfs_impl.c b/pci-arbiter/netfs_impl.c
index 2087cfb4..9a4b4d30 100644
--- a/pci-arbiter/netfs_impl.c
+++ b/pci-arbiter/netfs_impl.c
@@ -563,3 +563,13 @@ netfs_node_norefs (struct node *node)
 {
   destroy_node (node);
 }
+
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
diff --git a/procfs/netfs.c b/procfs/netfs.c
index 9410bddd..66013f50 100644
--- a/procfs/netfs.c
+++ b/procfs/netfs.c
@@ -199,6 +199,16 @@ error_t netfs_get_dirents (struct iouser *cred, struct 
node *dir,
   return 0;
 }
 
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 /* The user must define this function.  Lookup NAME in DIR (which is
    locked) for USER; set *NP to the found name upon return.  If the
    name was not found, then return ENOENT.  On any error, clear *NP.
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 7084d4a5..3efc0d86 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -882,6 +882,16 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
                      entry, nentries, bufsize, amt);
 }
 
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 error_t
 netfs_file_get_storage_info (struct iouser *cred,
                             struct node *np,
diff --git a/usermux/mux.c b/usermux/mux.c
index 7c57f940..1c76ccea 100644
--- a/usermux/mux.c
+++ b/usermux/mux.c
@@ -270,6 +270,17 @@ netfs_get_dirents (struct iouser *cred, struct node *dir,
 
   return err;
 }
+
+/* Return a memory object proxy port (send right) for the file contents of NP.
+   PROT is the maximum allowable access. On errors, return MACH_PORT_NULL and
+   set errno. */
+mach_port_t
+netfs_get_filemap (struct node *node, vm_prot_t prot)
+{
+  errno = EOPNOTSUPP;
+  return MACH_PORT_NULL;
+}
+
 
 /* User lookup.  */
 
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]