xref: /freebsd/sys/fs/tmpfs/tmpfs.h (revision 58a08f9e9910ea986e0f1103f47274a781b11874)
1 /*	$NetBSD: tmpfs.h,v 1.26 2007/02/22 06:37:00 thorpej Exp $	*/
2 
3 /*-
4  * SPDX-License-Identifier: BSD-2-Clause-NetBSD
5  *
6  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
7  * All rights reserved.
8  *
9  * This code is derived from software contributed to The NetBSD Foundation
10  * by Julio M. Merino Vidal, developed as part of Google's Summer of Code
11  * 2005 program.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 1. Redistributions of source code must retain the above copyright
17  *    notice, this list of conditions and the following disclaimer.
18  * 2. Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the
20  *    documentation and/or other materials provided with the distribution.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
23  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $FreeBSD$
35  */
36 
37 #ifndef _FS_TMPFS_TMPFS_H_
38 #define _FS_TMPFS_TMPFS_H_
39 
40 #include <sys/cdefs.h>
41 #include <sys/queue.h>
42 #include <sys/tree.h>
43 
44 #ifdef	_SYS_MALLOC_H_
45 MALLOC_DECLARE(M_TMPFSNAME);
46 #endif
47 
48 /*
49  * Internal representation of a tmpfs directory entry.
50  */
51 
52 LIST_HEAD(tmpfs_dir_duphead, tmpfs_dirent);
53 
54 struct tmpfs_dirent {
55 	/*
56 	 * Depending on td_cookie flag entry can be of 3 types:
57 	 * - regular -- no hash collisions, stored in RB-Tree
58 	 * - duphead -- synthetic linked list head for dup entries
59 	 * - dup -- stored in linked list instead of RB-Tree
60 	 */
61 	union {
62 		/* regular and duphead entry types */
63 		RB_ENTRY(tmpfs_dirent)		td_entries;
64 
65 		/* dup entry type */
66 		struct {
67 			LIST_ENTRY(tmpfs_dirent) entries;
68 			LIST_ENTRY(tmpfs_dirent) index_entries;
69 		} td_dup;
70 	} uh;
71 
72 	uint32_t			td_cookie;
73 	uint32_t			td_hash;
74 	u_int				td_namelen;
75 
76 	/*
77 	 * Pointer to the node this entry refers to.  In case this field
78 	 * is NULL, the node is a whiteout.
79 	 */
80 	struct tmpfs_node *		td_node;
81 
82 	union {
83 		/*
84 		 * The name of the entry, allocated from a string pool.  This
85 		 * string is not required to be zero-terminated.
86 		 */
87 		char *			td_name;	/* regular, dup */
88 		struct tmpfs_dir_duphead td_duphead;	/* duphead */
89 	} ud;
90 };
91 
92 /*
93  * A directory in tmpfs holds a collection of directory entries, which
94  * in turn point to other files (which can be directories themselves).
95  *
96  * In tmpfs, this collection is managed by a RB-Tree, whose head is
97  * defined by the struct tmpfs_dir type.
98  *
99  * It is important to notice that directories do not have entries for . and
100  * .. as other file systems do.  These can be generated when requested
101  * based on information available by other means, such as the pointer to
102  * the node itself in the former case or the pointer to the parent directory
103  * in the latter case.  This is done to simplify tmpfs's code and, more
104  * importantly, to remove redundancy.
105  */
106 RB_HEAD(tmpfs_dir, tmpfs_dirent);
107 
108 /*
109  * Each entry in a directory has a cookie that identifies it.  Cookies
110  * supersede offsets within directories because, given how tmpfs stores
111  * directories in memory, there is no such thing as an offset.
112  *
113  * The '.', '..' and the end of directory markers have fixed cookies which
114  * cannot collide with the cookies generated by other entries.  The cookies
115  * for the other entries are generated based on the file name hash value or
116  * unique number in case of name hash collision.
117  *
118  * To preserve compatibility cookies are limited to 31 bits.
119  */
120 
121 #define	TMPFS_DIRCOOKIE_DOT		0
122 #define	TMPFS_DIRCOOKIE_DOTDOT		1
123 #define	TMPFS_DIRCOOKIE_EOF		2
124 #define	TMPFS_DIRCOOKIE_MASK		((off_t)0x3fffffffU)
125 #define	TMPFS_DIRCOOKIE_MIN		((off_t)0x00000004U)
126 #define	TMPFS_DIRCOOKIE_DUP		((off_t)0x40000000U)
127 #define	TMPFS_DIRCOOKIE_DUPHEAD		((off_t)0x80000000U)
128 #define	TMPFS_DIRCOOKIE_DUP_MIN		TMPFS_DIRCOOKIE_DUP
129 #define	TMPFS_DIRCOOKIE_DUP_MAX		\
130 	(TMPFS_DIRCOOKIE_DUP | TMPFS_DIRCOOKIE_MASK)
131 
132 /*
133  * Internal representation of a tmpfs file system node.
134  *
135  * This structure is splitted in two parts: one holds attributes common
136  * to all file types and the other holds data that is only applicable to
137  * a particular type.  The code must be careful to only access those
138  * attributes that are actually allowed by the node's type.
139  *
140  * Below is the key of locks used to protected the fields in the following
141  * structures.
142  * (v)  vnode lock in exclusive mode
143  * (vi) vnode lock in exclusive mode, or vnode lock in shared vnode and
144  *	tn_interlock
145  * (i)  tn_interlock
146  * (m)  tmpfs_mount tm_allnode_lock
147  * (c)  stable after creation
148  */
149 struct tmpfs_node {
150 	/*
151 	 * Doubly-linked list entry which links all existing nodes for
152 	 * a single file system.  This is provided to ease the removal
153 	 * of all nodes during the unmount operation, and to support
154 	 * the implementation of VOP_VNTOCNP().  tn_attached is false
155 	 * when the node is removed from list and unlocked.
156 	 */
157 	LIST_ENTRY(tmpfs_node)	tn_entries;	/* (m) */
158 
159 	/* Node identifier. */
160 	ino_t			tn_id;		/* (c) */
161 
162 	/*
163 	 * The node's type.  Any of 'VBLK', 'VCHR', 'VDIR', 'VFIFO',
164 	 * 'VLNK', 'VREG' and 'VSOCK' is allowed.  The usage of vnode
165 	 * types instead of a custom enumeration is to make things simpler
166 	 * and faster, as we do not need to convert between two types.
167 	 */
168 	enum vtype		tn_type;	/* (c) */
169 
170 	/*
171 	 * See the top comment. Reordered here to fill LP64 hole.
172 	 */
173 	bool			tn_attached;	/* (m) */
174 
175 	/*
176 	 * Node's internal status.  This is used by several file system
177 	 * operations to do modifications to the node in a delayed
178 	 * fashion.
179 	 *
180 	 * tn_accessed has a dedicated byte to allow update by store without
181 	 * using atomics.  This provides a micro-optimization to e.g.
182 	 * tmpfs_read_pgcache().
183 	 */
184 	uint8_t			tn_status;	/* (vi) */
185 	uint8_t			tn_accessed;	/* unlocked */
186 
187 	/*
188 	 * The node size.  It does not necessarily match the real amount
189 	 * of memory consumed by it.
190 	 */
191 	off_t			tn_size;	/* (v) */
192 
193 	/* Generic node attributes. */
194 	uid_t			tn_uid;		/* (v) */
195 	gid_t			tn_gid;		/* (v) */
196 	mode_t			tn_mode;	/* (v) */
197 	int			tn_links;	/* (v) */
198 	u_long			tn_flags;	/* (v) */
199 	struct timespec		tn_atime;	/* (vi) */
200 	struct timespec		tn_mtime;	/* (vi) */
201 	struct timespec		tn_ctime;	/* (vi) */
202 	struct timespec		tn_birthtime;	/* (v) */
203 	unsigned long		tn_gen;		/* (c) */
204 
205 	/*
206 	 * As there is a single vnode for each active file within the
207 	 * system, care has to be taken to avoid allocating more than one
208 	 * vnode per file.  In order to do this, a bidirectional association
209 	 * is kept between vnodes and nodes.
210 	 *
211 	 * Whenever a vnode is allocated, its v_data field is updated to
212 	 * point to the node it references.  At the same time, the node's
213 	 * tn_vnode field is modified to point to the new vnode representing
214 	 * it.  Further attempts to allocate a vnode for this same node will
215 	 * result in returning a new reference to the value stored in
216 	 * tn_vnode.
217 	 *
218 	 * May be NULL when the node is unused (that is, no vnode has been
219 	 * allocated for it or it has been reclaimed).
220 	 */
221 	struct vnode *		tn_vnode;	/* (i) */
222 
223 	/*
224 	 * Interlock to protect tn_vpstate, and tn_status under shared
225 	 * vnode lock.
226 	 */
227 	struct mtx	tn_interlock;
228 
229 	/*
230 	 * Identify if current node has vnode assiocate with
231 	 * or allocating vnode.
232 	 */
233 	int		tn_vpstate;		/* (i) */
234 
235 	/* Transient refcounter on this node. */
236 	u_int		tn_refcount;		/* 0<->1 (m) + (i) */
237 
238 	/* misc data field for different tn_type node */
239 	union {
240 		/* Valid when tn_type == VBLK || tn_type == VCHR. */
241 		dev_t			tn_rdev;	/* (c) */
242 
243 		/* Valid when tn_type == VDIR. */
244 		struct tn_dir {
245 			/*
246 			 * Pointer to the parent directory.  The root
247 			 * directory has a pointer to itself in this field;
248 			 * this property identifies the root node.
249 			 */
250 			struct tmpfs_node *	tn_parent;
251 
252 			/*
253 			 * Head of a tree that links the contents of
254 			 * the directory together.
255 			 */
256 			struct tmpfs_dir	tn_dirhead;
257 
258 			/*
259 			 * Head of a list the contains fake directory entries
260 			 * heads, i.e. entries with TMPFS_DIRCOOKIE_DUPHEAD
261 			 * flag.
262 			 */
263 			struct tmpfs_dir_duphead tn_dupindex;
264 
265 			/*
266 			 * Number and pointer of the first directory entry
267 			 * returned by the readdir operation if it were
268 			 * called again to continue reading data from the
269 			 * same directory as before.  This is used to speed
270 			 * up reads of long directories, assuming that no
271 			 * more than one read is in progress at a given time.
272 			 * Otherwise, these values are discarded.
273 			 */
274 			off_t			tn_readdir_lastn;
275 			struct tmpfs_dirent *	tn_readdir_lastp;
276 		} tn_dir;
277 
278 		/* Valid when tn_type == VLNK. */
279 		/* The link's target, allocated from a string pool. */
280 		char *			tn_link;	/* (c) */
281 
282 		/* Valid when tn_type == VREG. */
283 		struct tn_reg {
284 			/*
285 			 * The contents of regular files stored in a
286 			 * tmpfs file system are represented by a
287 			 * single anonymous memory object (aobj, for
288 			 * short).  The aobj provides direct access to
289 			 * any position within the file.  It is a task
290 			 * of the memory management subsystem to issue
291 			 * the required page ins or page outs whenever
292 			 * a position within the file is accessed.
293 			 */
294 			vm_object_t		tn_aobj;	/* (c) */
295 			struct tmpfs_mount	*tn_tmp;	/* (c) */
296 		} tn_reg;
297 	} tn_spec;	/* (v) */
298 };
299 LIST_HEAD(tmpfs_node_list, tmpfs_node);
300 
301 #define tn_rdev tn_spec.tn_rdev
302 #define tn_dir tn_spec.tn_dir
303 #define tn_link tn_spec.tn_link
304 #define tn_reg tn_spec.tn_reg
305 #define tn_fifo tn_spec.tn_fifo
306 
307 #define	TMPFS_LINK_MAX INT_MAX
308 
309 #define TMPFS_NODE_LOCK(node) mtx_lock(&(node)->tn_interlock)
310 #define TMPFS_NODE_UNLOCK(node) mtx_unlock(&(node)->tn_interlock)
311 #define TMPFS_NODE_MTX(node) (&(node)->tn_interlock)
312 #define	TMPFS_NODE_ASSERT_LOCKED(node) mtx_assert(TMPFS_NODE_MTX(node), \
313     MA_OWNED)
314 
315 #ifdef INVARIANTS
316 #define TMPFS_ASSERT_LOCKED(node) do {					\
317 		MPASS((node) != NULL);					\
318 		MPASS((node)->tn_vnode != NULL);			\
319 		ASSERT_VOP_LOCKED((node)->tn_vnode, "tmpfs assert");	\
320 	} while (0)
321 #else
322 #define TMPFS_ASSERT_LOCKED(node) (void)0
323 #endif
324 
325 /* tn_vpstate */
326 #define TMPFS_VNODE_ALLOCATING	1
327 #define TMPFS_VNODE_WANT	2
328 #define TMPFS_VNODE_DOOMED	4
329 #define	TMPFS_VNODE_WRECLAIM	8
330 
331 /* tn_status */
332 #define	TMPFS_NODE_MODIFIED	0x01
333 #define	TMPFS_NODE_CHANGED	0x02
334 
335 /*
336  * Internal representation of a tmpfs mount point.
337  */
338 struct tmpfs_mount {
339 	/*
340 	 * Original value of the "size" parameter, for reference purposes,
341 	 * mostly.
342 	 */
343 	off_t			tm_size_max;
344 	/*
345 	 * Maximum number of memory pages available for use by the file
346 	 * system, set during mount time.  This variable must never be
347 	 * used directly as it may be bigger than the current amount of
348 	 * free memory; in the extreme case, it will hold the ULONG_MAX
349 	 * value.
350 	 */
351 	u_long			tm_pages_max;
352 
353 	/* Number of pages in use by the file system. */
354 	u_long			tm_pages_used;
355 
356 	/*
357 	 * Pointer to the node representing the root directory of this
358 	 * file system.
359 	 */
360 	struct tmpfs_node *	tm_root;
361 
362 	/*
363 	 * Maximum number of possible nodes for this file system; set
364 	 * during mount time.  We need a hard limit on the maximum number
365 	 * of nodes to avoid allocating too much of them; their objects
366 	 * cannot be released until the file system is unmounted.
367 	 * Otherwise, we could easily run out of memory by creating lots
368 	 * of empty files and then simply removing them.
369 	 */
370 	ino_t			tm_nodes_max;
371 
372 	/* unrhdr used to allocate inode numbers */
373 	struct unrhdr64		tm_ino_unr;
374 
375 	/* Number of nodes currently that are in use. */
376 	ino_t			tm_nodes_inuse;
377 
378 	/* Refcounter on this struct tmpfs_mount. */
379 	uint64_t		tm_refcount;
380 
381 	/* maximum representable file size */
382 	u_int64_t		tm_maxfilesize;
383 
384 	/*
385 	 * The used list contains all nodes that are currently used by
386 	 * the file system; i.e., they refer to existing files.
387 	 */
388 	struct tmpfs_node_list	tm_nodes_used;
389 
390 	/* All node lock to protect the node list and tmp_pages_used. */
391 	struct mtx		tm_allnode_lock;
392 
393 	/* Read-only status. */
394 	bool			tm_ronly;
395 	/* Do not use namecache. */
396 	bool			tm_nonc;
397 	/* Do not update mtime on writes through mmaped areas. */
398 	bool			tm_nomtime;
399 };
400 #define	TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock)
401 #define	TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock)
402 #define	TMPFS_MP_ASSERT_LOCKED(tm) mtx_assert(&(tm)->tm_allnode_lock, MA_OWNED)
403 
404 /*
405  * This structure maps a file identifier to a tmpfs node.  Used by the
406  * NFS code.
407  */
408 struct tmpfs_fid_data {
409 	ino_t			tfd_id;
410 	unsigned long		tfd_gen;
411 };
412 _Static_assert(sizeof(struct tmpfs_fid_data) <= MAXFIDSZ,
413     "(struct tmpfs_fid_data) is larger than (struct fid).fid_data");
414 
415 struct tmpfs_dir_cursor {
416 	struct tmpfs_dirent	*tdc_current;
417 	struct tmpfs_dirent	*tdc_tree;
418 };
419 
420 #ifdef _KERNEL
421 /*
422  * Prototypes for tmpfs_subr.c.
423  */
424 
425 void	tmpfs_ref_node(struct tmpfs_node *node);
426 int	tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype,
427 	    uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *,
428 	    const char *, dev_t, struct tmpfs_node **);
429 int	tmpfs_fo_close(struct file *fp, struct thread *td);
430 void	tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *);
431 bool	tmpfs_free_node_locked(struct tmpfs_mount *, struct tmpfs_node *, bool);
432 void	tmpfs_free_tmp(struct tmpfs_mount *);
433 int	tmpfs_alloc_dirent(struct tmpfs_mount *, struct tmpfs_node *,
434 	    const char *, u_int, struct tmpfs_dirent **);
435 void	tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *);
436 void	tmpfs_dirent_init(struct tmpfs_dirent *, const char *, u_int);
437 void	tmpfs_destroy_vobject(struct vnode *vp, vm_object_t obj);
438 int	tmpfs_alloc_vp(struct mount *, struct tmpfs_node *, int,
439 	    struct vnode **);
440 void	tmpfs_free_vp(struct vnode *);
441 int	tmpfs_alloc_file(struct vnode *, struct vnode **, struct vattr *,
442 	    struct componentname *, const char *);
443 void	tmpfs_check_mtime(struct vnode *);
444 void	tmpfs_dir_attach(struct vnode *, struct tmpfs_dirent *);
445 void	tmpfs_dir_detach(struct vnode *, struct tmpfs_dirent *);
446 void	tmpfs_dir_destroy(struct tmpfs_mount *, struct tmpfs_node *);
447 struct tmpfs_dirent *	tmpfs_dir_lookup(struct tmpfs_node *node,
448 			    struct tmpfs_node *f,
449 			    struct componentname *cnp);
450 int	tmpfs_dir_getdents(struct tmpfs_mount *, struct tmpfs_node *,
451 	    struct uio *, int, u_long *, int *);
452 int	tmpfs_dir_whiteout_add(struct vnode *, struct componentname *);
453 void	tmpfs_dir_whiteout_remove(struct vnode *, struct componentname *);
454 int	tmpfs_reg_resize(struct vnode *, off_t, boolean_t);
455 int	tmpfs_chflags(struct vnode *, u_long, struct ucred *, struct thread *);
456 int	tmpfs_chmod(struct vnode *, mode_t, struct ucred *, struct thread *);
457 int	tmpfs_chown(struct vnode *, uid_t, gid_t, struct ucred *,
458 	    struct thread *);
459 int	tmpfs_chsize(struct vnode *, u_quad_t, struct ucred *, struct thread *);
460 int	tmpfs_chtimes(struct vnode *, struct vattr *, struct ucred *cred,
461 	    struct thread *);
462 void	tmpfs_itimes(struct vnode *, const struct timespec *,
463 	    const struct timespec *);
464 
465 void	tmpfs_set_accessed(struct tmpfs_mount *tm, struct tmpfs_node *node);
466 void	tmpfs_set_status(struct tmpfs_mount *tm, struct tmpfs_node *node,
467 	    int status);
468 int	tmpfs_truncate(struct vnode *, off_t);
469 struct tmpfs_dirent *tmpfs_dir_first(struct tmpfs_node *dnode,
470 	    struct tmpfs_dir_cursor *dc);
471 struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node *dnode,
472 	    struct tmpfs_dir_cursor *dc);
473 static __inline void
474 tmpfs_update(struct vnode *vp)
475 {
476 
477 	tmpfs_itimes(vp, NULL, NULL);
478 }
479 
480 /*
481  * Convenience macros to simplify some logical expressions.
482  */
483 #define IMPLIES(a, b) (!(a) || (b))
484 #define IFF(a, b) (IMPLIES(a, b) && IMPLIES(b, a))
485 
486 /*
487  * Checks that the directory entry pointed by 'de' matches the name 'name'
488  * with a length of 'len'.
489  */
490 #define TMPFS_DIRENT_MATCHES(de, name, len) \
491     (de->td_namelen == len && \
492     bcmp((de)->ud.td_name, (name), (de)->td_namelen) == 0)
493 
494 /*
495  * Ensures that the node pointed by 'node' is a directory and that its
496  * contents are consistent with respect to directories.
497  */
498 #define TMPFS_VALIDATE_DIR(node) do { \
499 	MPASS((node)->tn_type == VDIR); \
500 	MPASS((node)->tn_size % sizeof(struct tmpfs_dirent) == 0); \
501 } while (0)
502 
503 /*
504  * Amount of memory pages to reserve for the system (e.g., to not use by
505  * tmpfs).
506  */
507 #if !defined(TMPFS_PAGES_MINRESERVED)
508 #define TMPFS_PAGES_MINRESERVED		(4 * 1024 * 1024 / PAGE_SIZE)
509 #endif
510 
511 size_t tmpfs_mem_avail(void);
512 size_t tmpfs_pages_used(struct tmpfs_mount *tmp);
513 void tmpfs_subr_init(void);
514 void tmpfs_subr_uninit(void);
515 
516 /*
517  * Macros/functions to convert from generic data structures to tmpfs
518  * specific ones.
519  */
520 
521 static inline struct tmpfs_mount *
522 VFS_TO_TMPFS(struct mount *mp)
523 {
524 	struct tmpfs_mount *tmp;
525 
526 	MPASS(mp != NULL && mp->mnt_data != NULL);
527 	tmp = (struct tmpfs_mount *)mp->mnt_data;
528 	return (tmp);
529 }
530 
531 static inline struct tmpfs_node *
532 VP_TO_TMPFS_NODE(struct vnode *vp)
533 {
534 	struct tmpfs_node *node;
535 
536 	MPASS(vp != NULL && vp->v_data != NULL);
537 	node = (struct tmpfs_node *)vp->v_data;
538 	return (node);
539 }
540 
541 #define	VP_TO_TMPFS_NODE_SMR(vp)	\
542 	((struct tmpfs_node *)vn_load_v_data_smr(vp))
543 
544 static inline struct tmpfs_node *
545 VP_TO_TMPFS_DIR(struct vnode *vp)
546 {
547 	struct tmpfs_node *node;
548 
549 	node = VP_TO_TMPFS_NODE(vp);
550 	TMPFS_VALIDATE_DIR(node);
551 	return (node);
552 }
553 
554 static inline bool
555 tmpfs_use_nc(struct vnode *vp)
556 {
557 
558 	return (!(VFS_TO_TMPFS(vp->v_mount)->tm_nonc));
559 }
560 
561 static inline void
562 tmpfs_update_getattr(struct vnode *vp)
563 {
564 	struct tmpfs_node *node;
565 
566 	node = VP_TO_TMPFS_NODE(vp);
567 	if (__predict_false((node->tn_status & (TMPFS_NODE_MODIFIED |
568 	    TMPFS_NODE_CHANGED)) != 0 || node->tn_accessed))
569 		tmpfs_update(vp);
570 }
571 
572 extern struct fileops tmpfs_fnops;
573 
574 #endif /* _KERNEL */
575 
576 #endif /* _FS_TMPFS_TMPFS_H_ */
577