Deleted Added
sdiff udiff text old ( 253573 ) new ( 254741 )
full compact
1/* $NetBSD: tmpfs_vfsops.c,v 1.10 2005/12/11 12:24:29 christos Exp $ */
2
3/*-
4 * Copyright (c) 2005 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Julio M. Merino Vidal, developed as part of Google's Summer of Code

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

36 * tmpfs is a file system that uses NetBSD's virtual memory sub-system
37 * (the well-known UVM) to store file data and metadata in an efficient
38 * way. This means that it does not follow the structure of an on-disk
39 * file system because it simply does not need to. Instead, it uses
40 * memory-specific data structures and algorithms to automatically
41 * allocate and release resources.
42 */
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/fs/tmpfs/tmpfs_vfsops.c 253573 2013-07-23 14:48:37Z nwhitehorn $");
45
46#include <sys/param.h>
47#include <sys/limits.h>
48#include <sys/lock.h>
49#include <sys/mutex.h>
50#include <sys/kernel.h>
51#include <sys/stat.h>
52#include <sys/systm.h>
53#include <sys/sysctl.h>
54
55#include <vm/vm.h>
56#include <vm/vm_object.h>
57#include <vm/vm_param.h>

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

133
134static int
135tmpfs_mount(struct mount *mp)
136{
137 const size_t nodes_per_page = howmany(PAGE_SIZE,
138 sizeof(struct tmpfs_dirent) + sizeof(struct tmpfs_node));
139 struct tmpfs_mount *tmp;
140 struct tmpfs_node *root;
141 int error;
142 /* Size counters. */
143 u_quad_t pages;
144 off_t nodes_max, size_max, maxfilesize;
145
146 /* Root node attributes. */
147 uid_t root_uid;
148 gid_t root_gid;
149 mode_t root_mode;
150
151 struct vattr va;
152
153 if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts))
154 return (EINVAL);
155
156 if (mp->mnt_flag & MNT_UPDATE) {
157 /* Only support update mounts for certain options. */
158 if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0)
159 return (EOPNOTSUPP);
160 if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) !=

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

415
416struct vfsops tmpfs_vfsops = {
417 .vfs_mount = tmpfs_mount,
418 .vfs_unmount = tmpfs_unmount,
419 .vfs_root = tmpfs_root,
420 .vfs_statfs = tmpfs_statfs,
421 .vfs_fhtovp = tmpfs_fhtovp,
422};
423VFS_SET(tmpfs_vfsops, tmpfs, 0);