[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 30/53: libnetfs: fix receiver lookups in fsys server functions
From: |
Samuel Thibault |
Subject: |
[hurd] 30/53: libnetfs: fix receiver lookups in fsys server functions |
Date: |
Thu, 20 Mar 2014 02:23:51 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 982261fec4707d0c8d0723d90d9c0e465d98aa93
Author: Justus Winter <address@hidden>
Date: Wed Feb 12 11:24:14 2014 +0100
libnetfs: fix receiver lookups in fsys server functions
* mutations.h: Add translation functions.
* netfs.h (struct netfs_control): New declaration.
* priv.h: Define translation functions.
* fsys-get-options.c: Fix receiver lookups.
* fsys-getroot.c: Likewise.
* fsys-goaway.c: Likewise.
* fsys-set-options.c: Likewise.
* fsys-syncfs.c: Likewise.
* fsysstubs.c: Likewise.
---
libnetfs/fsys-get-options.c | 6 +-----
libnetfs/fsys-getroot.c | 5 +----
libnetfs/fsys-goaway.c | 10 +++-------
libnetfs/fsys-set-options.c | 11 +++--------
libnetfs/fsys-syncfs.c | 2 +-
libnetfs/fsysstubs.c | 8 ++++----
libnetfs/mutations.h | 3 +++
libnetfs/netfs.h | 6 ++++++
libnetfs/priv.h | 14 ++++++++++++++
9 files changed, 36 insertions(+), 29 deletions(-)
diff --git a/libnetfs/fsys-get-options.c b/libnetfs/fsys-get-options.c
index 54bd9a0..836806b 100644
--- a/libnetfs/fsys-get-options.c
+++ b/libnetfs/fsys-get-options.c
@@ -31,7 +31,7 @@
/* Implement fsys_get_options as described in <hurd/fsys.defs>. */
error_t
-netfs_S_fsys_get_options (fsys_t fsys,
+netfs_S_fsys_get_options (struct netfs_control *port,
mach_port_t reply,
mach_msg_type_name_t reply_type,
char **data, mach_msg_type_number_t *data_len)
@@ -39,8 +39,6 @@ netfs_S_fsys_get_options (fsys_t fsys,
error_t err;
char *argz = 0;
size_t argz_len = 0;
- struct port_info *port =
- ports_lookup_port (netfs_port_bucket, fsys, netfs_control_class);
if (!port)
return EOPNOTSUPP;
@@ -63,7 +61,5 @@ netfs_S_fsys_get_options (fsys_t fsys,
else
free (argz);
- ports_port_deref (port);
-
return err;
}
diff --git a/libnetfs/fsys-getroot.c b/libnetfs/fsys-getroot.c
index 0d80111..2d02120 100644
--- a/libnetfs/fsys-getroot.c
+++ b/libnetfs/fsys-getroot.c
@@ -25,7 +25,7 @@
#include <fcntl.h>
error_t
-netfs_S_fsys_getroot (mach_port_t cntl,
+netfs_S_fsys_getroot (struct netfs_control *pt,
mach_port_t reply,
mach_msg_type_name_t reply_type,
mach_port_t dotdot,
@@ -37,8 +37,6 @@ netfs_S_fsys_getroot (mach_port_t cntl,
mach_port_t *retry_port,
mach_msg_type_name_t *retry_port_type)
{
- struct port_info *pt = ports_lookup_port (netfs_port_bucket, cntl,
- netfs_control_class);
struct iouser *cred;
error_t err;
struct protid *newpi;
@@ -51,7 +49,6 @@ netfs_S_fsys_getroot (mach_port_t cntl,
if (!pt)
return EOPNOTSUPP;
- ports_port_deref (pt);
err = iohelp_create_complex_iouser (&cred, uids, nuids, gids, ngids);
if (err)
diff --git a/libnetfs/fsys-goaway.c b/libnetfs/fsys-goaway.c
index 0ac36d3..872d073 100644
--- a/libnetfs/fsys-goaway.c
+++ b/libnetfs/fsys-goaway.c
@@ -26,17 +26,15 @@
#include <hurd/ports.h>
error_t
-netfs_S_fsys_goaway (fsys_t control,
+netfs_S_fsys_goaway (struct netfs_control *pt,
mach_port_t reply,
mach_msg_type_name_t reply_type,
int flags)
{
error_t err;
- struct port_info *pt;
- pt = ports_lookup_port (netfs_port_bucket, control,
- netfs_control_class);
- if (! pt)
+
+ if (!pt)
return EOPNOTSUPP;
err = netfs_shutdown (flags);
@@ -46,7 +44,5 @@ netfs_S_fsys_goaway (fsys_t control,
exit (0);
}
- ports_port_deref (pt);
-
return err;
}
diff --git a/libnetfs/fsys-set-options.c b/libnetfs/fsys-set-options.c
index d7dc743..fb1c87e 100644
--- a/libnetfs/fsys-set-options.c
+++ b/libnetfs/fsys-set-options.c
@@ -31,15 +31,15 @@
/* Implement fsys_set_options as described in <hurd/fsys.defs>. */
error_t
-netfs_S_fsys_set_options (fsys_t fsys,
+netfs_S_fsys_set_options (struct netfs_control *pt,
mach_port_t reply,
mach_msg_type_name_t reply_type,
char *data, mach_msg_type_number_t data_len,
int do_children)
{
error_t err = 0;
- struct port_info *pt =
- ports_lookup_port (netfs_port_bucket, fsys, netfs_control_class);
+ if (!pt)
+ return EOPNOTSUPP;
error_t
helper (struct node *np)
@@ -64,9 +64,6 @@ netfs_S_fsys_set_options (fsys_t fsys,
return error;
}
- if (!pt)
- return EOPNOTSUPP;
-
#if NOT_YET
if (do_children)
{
@@ -87,7 +84,5 @@ netfs_S_fsys_set_options (fsys_t fsys,
#endif
}
- ports_port_deref (pt);
-
return err;
}
diff --git a/libnetfs/fsys-syncfs.c b/libnetfs/fsys-syncfs.c
index f57cb14..e232936 100644
--- a/libnetfs/fsys-syncfs.c
+++ b/libnetfs/fsys-syncfs.c
@@ -22,7 +22,7 @@
#include "fsys_S.h"
error_t
-netfs_S_fsys_syncfs (mach_port_t cntl,
+netfs_S_fsys_syncfs (struct netfs_control *cntl,
mach_port_t reply,
mach_msg_type_name_t reply_type,
int wait,
diff --git a/libnetfs/fsysstubs.c b/libnetfs/fsysstubs.c
index f44155d..a64fd64 100644
--- a/libnetfs/fsysstubs.c
+++ b/libnetfs/fsysstubs.c
@@ -23,7 +23,7 @@
#include "fsys_S.h"
error_t
-netfs_S_fsys_getfile (fsys_t cntl,
+netfs_S_fsys_getfile (struct netfs_control *cntl,
mach_port_t reply,
mach_msg_type_name_t reply_type,
uid_t *uids, mach_msg_type_number_t nuids,
@@ -35,7 +35,7 @@ netfs_S_fsys_getfile (fsys_t cntl,
}
error_t
-netfs_S_fsys_getpriv (fsys_t cntl,
+netfs_S_fsys_getpriv (struct netfs_control *cntl,
mach_port_t reply,
mach_msg_type_name_t reply_type,
mach_port_t *host, mach_msg_type_name_t *hosttp,
@@ -46,7 +46,7 @@ netfs_S_fsys_getpriv (fsys_t cntl,
}
error_t
-netfs_S_fsys_init (fsys_t cntl,
+netfs_S_fsys_init (struct netfs_control *cntl,
mach_port_t reply,
mach_msg_type_name_t reply_type,
mach_port_t proc, auth_t auth)
@@ -55,7 +55,7 @@ netfs_S_fsys_init (fsys_t cntl,
}
error_t
-netfs_S_fsys_forward (fsys_t cntl,
+netfs_S_fsys_forward (mach_port_t cntl,
mach_port_t reply,
mach_msg_type_name_t reply_type,
mach_port_t request,
diff --git a/libnetfs/mutations.h b/libnetfs/mutations.h
index e6700f5..51ca871 100644
--- a/libnetfs/mutations.h
+++ b/libnetfs/mutations.h
@@ -28,6 +28,9 @@
#define IO_INTRAN protid_t begin_using_protid_port (io_t)
#define IO_DESTRUCTOR end_using_protid_port (protid_t)
+#define FSYS_INTRAN control_t begin_using_control_port (fsys_t)
+#define FSYS_DESTRUCTOR end_using_control_port (control_t)
+
#define FILE_IMPORTS import "netfs.h"; import "priv.h";
#define IO_IMPORTS import "netfs.h"; import "priv.h";
#define FSYS_IMPORTS import "netfs.h"; import "priv.h";
diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h
index 5d50f57..aef4a3d 100644
--- a/libnetfs/netfs.h
+++ b/libnetfs/netfs.h
@@ -100,6 +100,11 @@ struct node
struct dirmod *dirmod_reqs;
};
+struct netfs_control
+{
+ struct port_info pi;
+};
+
/* The user must define this variable. Set this to the name of the
filesystem server. */
extern char *netfs_server_name;
@@ -437,6 +442,7 @@ extern auth_t netfs_auth_server_port;
/* Mig gook. */
typedef struct protid *protid_t;
+typedef struct netfs_control *control_t;
#endif /* _HURD_NETFS_H_ */
diff --git a/libnetfs/priv.h b/libnetfs/priv.h
index 00db9fa..ba31080 100644
--- a/libnetfs/priv.h
+++ b/libnetfs/priv.h
@@ -37,4 +37,18 @@ end_using_protid_port (struct protid *cred)
if (cred)
ports_port_deref (cred);
}
+
+static inline struct netfs_control * __attribute__ ((unused))
+begin_using_control_port (fsys_t port)
+{
+ return ports_lookup_port (netfs_port_bucket, port, netfs_control_class);
+}
+
+static inline void __attribute__ ((unused))
+end_using_control_port (struct netfs_control *cred)
+{
+ if (cred)
+ ports_port_deref (cred);
+}
+
#endif
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 44/53: mach-defpager: fix warning about uninitialized variable, (continued)
- [hurd] 44/53: mach-defpager: fix warning about uninitialized variable, Samuel Thibault, 2014/03/19
- [hurd] 38/53: trans/ifsock: fix receiver lookup, Samuel Thibault, 2014/03/19
- [hurd] 40/53: mach-defpager: remove comments around form feeds, Samuel Thibault, 2014/03/19
- [hurd] 45/53: mach-defpager: fix warnings about uninitialized variables, Samuel Thibault, 2014/03/19
- [hurd] 41/53: mach-defpager: fix warnings about unused variables, Samuel Thibault, 2014/03/19
- [hurd] 32/53: pfinet: improve the mig mutator functions, Samuel Thibault, 2014/03/19
- [hurd] 47/53: mach-defpager: silently ignore requests to page to active partition, Samuel Thibault, 2014/03/19
- [hurd] 46/53: mach-defpager: fix type of size arguments, Samuel Thibault, 2014/03/19
- [hurd] 35/53: pfinet: fix receiver lookups in iioctl-ops.c, Samuel Thibault, 2014/03/19
- [hurd] 49/53: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/03/19
- [hurd] 30/53: libnetfs: fix receiver lookups in fsys server functions,
Samuel Thibault <=
- [hurd] 50/53: Fix crash on accessing vcs without a console being active, Samuel Thibault, 2014/03/19
- [hurd] 37/53: term: fix receiver lookups in the term server functions, Samuel Thibault, 2014/03/19
- [hurd] 33/53: libtrivfs: improve the mig mutator functions, Samuel Thibault, 2014/03/19
- [hurd] 51/53: Fix vcs_readlink propagating error returned by console_current_id, Samuel Thibault, 2014/03/19
- [hurd] 53/53: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/03/19
- [hurd] 52/53: Fix handling of console readlink errors, Samuel Thibault, 2014/03/19
- [hurd] 04/53: isofs: add bz2 to OTHERLIBS, Samuel Thibault, 2014/03/19
- [hurd] 11/53: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2014/03/19
- [hurd] 09/53: libdiskfs: fix typo, Samuel Thibault, 2014/03/19
- [hurd] 13/53: Add missing copyright notice, Samuel Thibault, 2014/03/19