diff options
author | Roland McGrath <roland@gnu.org> | 2000-12-27 00:57:36 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2000-12-27 00:57:36 +0000 |
commit | ce7fbed9739d385a2ed7dd1a813b1d45e506cf92 (patch) | |
tree | 6e9c2e5cd49938cdf597f4559d0f8551d5f88fc8 /tmpfs/tmpfs.h | |
parent | af536d3e0436a5d683bf8076337653ec2be0f0ee (diff) | |
download | hurd-ce7fbed9739d385a2ed7dd1a813b1d45e506cf92.tar.gz hurd-ce7fbed9739d385a2ed7dd1a813b1d45e506cf92.tar.bz2 hurd-ce7fbed9739d385a2ed7dd1a813b1d45e506cf92.zip |
New directory tmpfs, in-core filesystem based on libdiskfs
Diffstat (limited to 'tmpfs/tmpfs.h')
-rw-r--r-- | tmpfs/tmpfs.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/tmpfs/tmpfs.h b/tmpfs/tmpfs.h new file mode 100644 index 00000000..19f05de5 --- /dev/null +++ b/tmpfs/tmpfs.h @@ -0,0 +1,89 @@ +/* Private data structures for tmpfs. + Copyright (C) 2000 Free Software Foundation, Inc. + +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 the GNU Hurd; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _tmpfs_h +#define _tmpfs_h 1 + +#include <hurd/diskfs.h> +#include <sys/types.h> +#include <dirent.h> +#include <stdint.h> + +struct disknode +{ + uint_fast8_t type; /* DT_REG et al */ + + unsigned int gen; + off_t size; + mode_t mode; + nlink_t nlink; + uid_t uid, author; + gid_t gid; + time_t atime, mtime, ctime; + unsigned int flags; + + char *trans; + size_t translen; + + union + { + char *lnk; /* malloc'd symlink target */ + struct + { + mach_port_t memobj; + unsigned int allocpages; /* largest size while memobj was live */ + } reg; + struct + { + mach_port_t memobj; + unsigned int allocpages; /* largest size while memobj was live */ + }; + struct + { + struct tmpfs_dirent *entries; + struct disknode *dotdot; + } dir; + dev_t chr, blk; + } u; + + struct node *hnext, **hprevp; +}; + +struct tmpfs_dirent +{ + struct tmpfs_dirent *next; + struct disknode *dn; + uint8_t namelen; + char name[0]; +}; + +extern unsigned int num_files; +extern off_t tmpfs_page_limit, tmpfs_space_used; + +extern mach_port_t default_pager; + +static inline void +adjust_used (off_t change) +{ + spin_lock (&diskfs_node_refcnt_lock); + tmpfs_space_used += change; + spin_unlock (&diskfs_node_refcnt_lock); +} + +#endif |