diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-07-01 21:30:38 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-07-01 21:30:38 +0000 |
commit | b99a3ad650fec94f5f476dd739972b8cb6c8daca (patch) | |
tree | c445bdf36b64039d1130df1f6716a9e95cfd0bd6 /libnetfs | |
parent | 1f6601e1a657d7008f6c15fca71d2dc092f7cb78 (diff) |
1999-07-01 Thomas Bushnell, BSG <tb@mit.edu>
* nref.c: New file; guts from netfs.h.
* nrele.c: Likewise.
* nput.c: Likewise.
* netfs.h (netfs_nref, netfs_nrele, netfs_nput): Replace inline
definitions with normal declarations.
(NETFS_EI): Remove macro.
* netfs.c: Deleted file.
* Makefile (OTHERSRCS): Add nref.c, nrele.c, nput.c. Remove
netfs.c.
Diffstat (limited to 'libnetfs')
-rw-r--r-- | libnetfs/ChangeLog | 12 | ||||
-rw-r--r-- | libnetfs/Makefile | 3 | ||||
-rw-r--r-- | libnetfs/netfs.c | 3 | ||||
-rw-r--r-- | libnetfs/netfs.h | 45 | ||||
-rw-r--r-- | libnetfs/nput.c | 37 | ||||
-rw-r--r-- | libnetfs/nref.c | 29 | ||||
-rw-r--r-- | libnetfs/nrele.c | 36 |
7 files changed, 119 insertions, 46 deletions
diff --git a/libnetfs/ChangeLog b/libnetfs/ChangeLog index e24cbf9e..ae25f1d8 100644 --- a/libnetfs/ChangeLog +++ b/libnetfs/ChangeLog @@ -1,3 +1,15 @@ +1999-07-01 Thomas Bushnell, BSG <tb@mit.edu> + + * nref.c: New file; guts from netfs.h. + * nrele.c: Likewise. + * nput.c: Likewise. + * netfs.h (netfs_nref, netfs_nrele, netfs_nput): Replace inline + definitions with normal declarations. + (NETFS_EI): Remove macro. + * netfs.c: Deleted file. + * Makefile (OTHERSRCS): Add nref.c, nrele.c, nput.c. Remove + netfs.c. + Thu Mar 4 07:18:21 1999 Joel N. Weber II <devnull@theobromine.ai.mit.edu> * dir-lookup.c (netfs_S_dir_lookup): Only set newnode to 1 if the diff --git a/libnetfs/Makefile b/libnetfs/Makefile index 26c71f63..28dde970 100644 --- a/libnetfs/Makefile +++ b/libnetfs/Makefile @@ -46,7 +46,8 @@ OTHERSRCS= drop-node.c init-init.c make-node.c make-peropen.c make-protid.c \ init-loop.c demuxer.c shutdown.c release-protid.c release-peropen.c \ init-startup.c startup-argp.c set-options.c append-args.c \ runtime-argp.c std-runtime-argp.c std-startup-argp.c \ - append-std-options.c netfs.c trans-callback.c set-get-trans.c + append-std-options.c trans-callback.c set-get-trans.c \ + nref.c nrele.c nput.c SRCS= $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(IFSOCKSRCS) diff --git a/libnetfs/netfs.c b/libnetfs/netfs.c deleted file mode 100644 index a6b532ff..00000000 --- a/libnetfs/netfs.c +++ /dev/null @@ -1,3 +0,0 @@ -#define NETFS_EI -#include "netfs.h" - diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h index b2253dff..d75dfe39 100644 --- a/libnetfs/netfs.h +++ b/libnetfs/netfs.h @@ -24,10 +24,6 @@ #include <hurd/iohelp.h> #include <assert.h> -#ifndef NETFS_EI -#define NETFS_EI extern inline -#endif - /* This library supports client-side network file system implementations. It is analogous to the diskfs library provided for disk-based filesystems. */ @@ -337,44 +333,9 @@ extern struct node *netfs_root_node; extern mach_port_t netfs_fsys_identity; extern auth_t netfs_auth_server_port; -NETFS_EI void -netfs_nref (struct node *np) -{ - spin_lock (&netfs_node_refcnt_lock); - np->references++; - spin_unlock (&netfs_node_refcnt_lock); -} - -NETFS_EI void -netfs_nrele (struct node *np) -{ - spin_lock (&netfs_node_refcnt_lock); - assert (np->references); - np->references--; - if (np->references == 0) - { - mutex_lock (&np->lock); - netfs_drop_node (np); - } - else - spin_unlock (&netfs_node_refcnt_lock); -} - -NETFS_EI void -netfs_nput (struct node *np) -{ - spin_lock (&netfs_node_refcnt_lock); - assert (np->references); - np->references--; - if (np->references == 0) - netfs_drop_node (np); - else - { - spin_unlock (&netfs_node_refcnt_lock); - mutex_unlock (&np->lock); - } -} - +void netfs_nref (struct node *np); +void netfs_nrele (struct node *np); +void netfs_nput (struct node *np); /* Mig gook. */ diff --git a/libnetfs/nput.c b/libnetfs/nput.c new file mode 100644 index 00000000..1d19482a --- /dev/null +++ b/libnetfs/nput.c @@ -0,0 +1,37 @@ +/* + Copyright (C) 1999 Free Software Foundation, Inc. + Written by Thomas Bushnell, BSG. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + The GNU Hurd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ + +#include "priv.h" + +void +netfs_nput (struct node *np) +{ + spin_lock (&netfs_node_refcnt_lock); + assert (np->references); + np->references--; + if (np->references == 0) + netfs_drop_node (np); + else + { + spin_unlock (&netfs_node_refcnt_lock); + mutex_unlock (&np->lock); + } +} + diff --git a/libnetfs/nref.c b/libnetfs/nref.c new file mode 100644 index 00000000..f5a970da --- /dev/null +++ b/libnetfs/nref.c @@ -0,0 +1,29 @@ +/* + Copyright (C) 1999 Free Software Foundation, Inc. + Written by Thomas Bushnell, BSG. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + The GNU Hurd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ + +#include "priv.h" + +void +netfs_nref (struct node *np) +{ + spin_lock (&netfs_node_refcnt_lock); + np->references++; + spin_unlock (&netfs_node_refcnt_lock); +} diff --git a/libnetfs/nrele.c b/libnetfs/nrele.c new file mode 100644 index 00000000..0104e01d --- /dev/null +++ b/libnetfs/nrele.c @@ -0,0 +1,36 @@ +/* + Copyright (C) 1999 Free Software Foundation, Inc. + Written by Thomas Bushnell, BSG. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + The GNU Hurd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ + +#include "priv.h" + +void +netfs_nrele (struct node *np) +{ + spin_lock (&netfs_node_refcnt_lock); + assert (np->references); + np->references--; + if (np->references == 0) + { + mutex_lock (&np->lock); + netfs_drop_node (np); + } + else + spin_unlock (&netfs_node_refcnt_lock); +} |