Deleted Added
full compact
pseudofs.c (168387) pseudofs.c (168637)
1/*-
2 * Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/fs/pseudofs/pseudofs.c 168387 2007-04-05 13:43:00Z des $");
30__FBSDID("$FreeBSD: head/sys/fs/pseudofs/pseudofs.c 168637 2007-04-11 22:40:57Z des $");
31
32#include "opt_pseudofs.h"
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>
37#include <sys/lock.h>
38#include <sys/malloc.h>

--- 214 unchanged lines hidden (view full) ---

253 }
254 mtx_unlock(&node->pn_info->pi_mutex);
255 }
256
257 /* callback to free any private resources */
258 if (node->pn_destroy != NULL)
259 (node->pn_destroy)(node);
260
31
32#include "opt_pseudofs.h"
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/systm.h>
37#include <sys/lock.h>
38#include <sys/malloc.h>

--- 214 unchanged lines hidden (view full) ---

253 }
254 mtx_unlock(&node->pn_info->pi_mutex);
255 }
256
257 /* callback to free any private resources */
258 if (node->pn_destroy != NULL)
259 (node->pn_destroy)(node);
260
261 /* revoke vnodes and release memory */
262 pfs_disable(node);
261 /* revoke fileno and vnodes and release memory */
262 if (node->pn_fileno)
263 pfs_fileno_free(node->pn_info, node);
264 pfs_purge(node);
263 FREE(node, M_PFSNODES);
264
265 return (0);
266}
267
268/*
269 * Mount a pseudofs instance
270 */
271int
272pfs_mount(struct pfs_info *pi, struct mount *mp, struct thread *td)
273{
274 struct statfs *sbp;
275
276 if (mp->mnt_flag & MNT_UPDATE)
277 return (EOPNOTSUPP);
278
265 FREE(node, M_PFSNODES);
266
267 return (0);
268}
269
270/*
271 * Mount a pseudofs instance
272 */
273int
274pfs_mount(struct pfs_info *pi, struct mount *mp, struct thread *td)
275{
276 struct statfs *sbp;
277
278 if (mp->mnt_flag & MNT_UPDATE)
279 return (EOPNOTSUPP);
280
281 MNT_ILOCK(mp);
279 mp->mnt_flag |= MNT_LOCAL;
282 mp->mnt_flag |= MNT_LOCAL;
283#if 0
284 /* not quite ready for this yet */
285 mp->mnt_kern_flag |= MNTK_MPSAFE;
286#endif
287 MNT_IUNLOCK(mp);
280 mp->mnt_data = (qaddr_t)pi;
281 vfs_getnewfsid(mp);
282
283 sbp = &mp->mnt_stat;
284 vfs_mountedfrom(mp, pi->pi_name);
285 sbp->f_bsize = PAGE_SIZE;
286 sbp->f_iosize = PAGE_SIZE;
287 sbp->f_blocks = 1;

--- 94 unchanged lines hidden (view full) ---

382/*
383 * Destroy a pseudofs instance
384 */
385int
386pfs_uninit(struct pfs_info *pi, struct vfsconf *vfc)
387{
388 int error;
389
288 mp->mnt_data = (qaddr_t)pi;
289 vfs_getnewfsid(mp);
290
291 sbp = &mp->mnt_stat;
292 vfs_mountedfrom(mp, pi->pi_name);
293 sbp->f_bsize = PAGE_SIZE;
294 sbp->f_iosize = PAGE_SIZE;
295 sbp->f_blocks = 1;

--- 94 unchanged lines hidden (view full) ---

390/*
391 * Destroy a pseudofs instance
392 */
393int
394pfs_uninit(struct pfs_info *pi, struct vfsconf *vfc)
395{
396 int error;
397
390 pfs_fileno_uninit(pi);
391 pfs_destroy(pi->pi_root);
392 pi->pi_root = NULL;
398 pfs_destroy(pi->pi_root);
399 pi->pi_root = NULL;
400 pfs_fileno_uninit(pi);
393 mtx_destroy(&pi->pi_mutex);
394 if (bootverbose)
395 printf("%s unregistered\n", pi->pi_name);
396 error = (pi->pi_uninit)(pi, vfc);
397 return (error);
398}
399
400/*

--- 30 unchanged lines hidden ---
401 mtx_destroy(&pi->pi_mutex);
402 if (bootverbose)
403 printf("%s unregistered\n", pi->pi_name);
404 error = (pi->pi_uninit)(pi, vfc);
405 return (error);
406}
407
408/*

--- 30 unchanged lines hidden ---