Commit Graph

1595 Commits

Author SHA1 Message Date
hannken
accb62aedc Change puffs from hashlist to vcache.
- field "pa_nhashbuckets" of struct "puffs_kargs" becomes a no-op.
  and should be removed on the next protocol version bump.
2014-08-28 08:29:50 +00:00
maxv
5f2f7d8e15 Remove dead returns:
return VAR/func(XX);
	return VAR;

The latter is never reached. Sent on tech-kern@, no disagreement.
2014-08-21 06:40:35 +00:00
manu
7642144c05 Add a oflags input field to open requests so that the filesystem can pass
back information about the file. Implement PUFFS_OPEN_IO_DIRECT, which
will force direct IO (bypassing page cache) for the file.
2014-08-16 16:19:41 +00:00
hannken
b041904f72 Needs HASH_SLIST, not HASH_LIST. 2014-08-16 07:22:30 +00:00
hannken
912cfee7bf Change ptyfs to vcache.
- Use (type, minor) as key.
- Change ptyfs_allocvp to return a referenced vnode and lock where needed.
- Remove unneeded vnode backpointer ptyfs_vnode.
- Keep a single hashlist for pty nodes to make their attributes persistent.

OK: Christos Zoulas
2014-08-15 13:40:39 +00:00
maxv
b0e4602c25 Overflow if *data_len == OSIZE and args->version >= PTYFS_ARGSVERSION.
Sent on tech-kern@, ok christos@
2014-08-14 14:06:53 +00:00
hannken
2607f151da - Add a map of active controlling ptys per mount and no longer abuse
the vnode lifecycle.
- No longer set "recycle" on VOP_INACTIVE().
- Make ptyfs_used_get() private to ptyfs_subr.c
- Stop copying device attributes from traditional ptys on first allocation.
- Remove unneeded argument "lwp" from ptyfs_allocvp() and ptyfs_free_get().

OK: Christos Zoulas
2014-08-13 14:10:00 +00:00
maxv
10b6c96ec4 http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html#Report-2
#04-0x01: Uninitialized var 'rqp' (does not compile anyway)
2014-08-12 06:57:20 +00:00
hannken
265f1d8cdb Change hfs from hashlist to vcache.
- use (cnid, fork) as key.
- use pool for hfs nodes.
2014-08-10 08:53:22 +00:00
gson
f3b28c737c Whitespace fix 2014-08-08 19:14:45 +00:00
hannken
5d6be57d01 Change efs from hashlist to vcache. 2014-08-07 08:24:23 +00:00
hannken
ea4bd7d40f Change adosfs from hashlist to vcache.
- point ap->block to real file header block for hard links.
2014-08-05 08:50:54 +00:00
reinoud
e3b6b3457e Posix requires the va_size of a symlink to be pathlength for symbolic links.
This fixes yet another atf case.
2014-07-29 15:48:22 +00:00
reinoud
60e6f474d5 Fix debug printout of udf_write_metadata_partition_spacetable(), it referred
to an old variable.
2014-07-29 15:36:43 +00:00
reinoud
a72b8dae23 Access time should only be set on accessing the data or messing with the
contents, not on inode access rights and ownership changes. Should address
PR kern/49033 for UDF.

Test results now come clean for bugs related to this issue in the ATF.
2014-07-29 11:10:12 +00:00
dholland
05d075b3ae Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

The filesystem ones all call genfs_eopnotsupp - right now I am only
implementing the plumbing and we can implement fallocate and/or
fdiscard for files later.

The device ones call spec_fallocate (which is also genfs_eopnotsupp)
and spec_fdiscard, which dispatches to the device-level op.

The fifo ones all call vn_fifo_bypass, which also ends up being
EOPNOTSUPP.
2014-07-25 08:20:51 +00:00
maxv
549e231932 Make DPRINTF more understandable, and replace my previous #ifdef DIAGNOSTIC... 2014-07-18 17:24:34 +00:00
maxv
8ee3c88d2b Limit the minimum size of a disk sector to 512 bytes, to prevent memory
overflow on extremely low secsize. This normally conforms to the old standard
(for which there doesn't seem to be a clear spec). Since 2011, IDEMA's Advanced
Format standardizes it to 4k, so this change won't cause any trouble on
new devices.

Put the printf under DIAGNOSTIC temporarily to see if someone complains.

after a quick discussion on tech-kern
2014-07-16 20:09:00 +00:00
christos
c0371c86f3 Correct the bread size of struct fsinfo from Gerald Lee at DELL dot com 2014-07-15 11:43:54 +00:00
maxv
409868ac4b smbfs depends on nsmb, so add the dependency as appropriate. Fixes
# modload smbfs
on modular kernels, PR kern/40011, and probably system crashes.
2014-07-14 16:29:50 +00:00
maxv
56ce0b03bc Minor changes:
- malloc()+memset() -> malloc(|M_ZERO)
 - rename 'vers' to 'FSVers'
 - declare 'ExtFlags' instead of calling getushort() two times
2014-07-09 09:00:18 +00:00
maxv
8fce630b04 Remove ROOTNAME (unused). 2014-07-09 08:43:54 +00:00
maxv
1273c3cb8c - Perform sanity checks not just for GEMDOSFS, but for all FAT devices. This
also fixes a division-by-zero bug that could crash the system.
- Define GEMDOSFS_BSIZE instead of a hard-coded 512 value, and remove 'bsize'.
- Rename 'tmp' to 'BlkPerSec'.

From me, FreeBSD, OpenBSD and the FAT specification.

ok christos@
2014-07-08 19:34:47 +00:00
hannken
798256c9ef Change msdosfs from hashlist to vcache:
- Use (dir_cluster, dir_offset, dir_generation) as key, where
  dir_generation is non-zero and unique for unlinked but open nodes.
- Change deget() to return a vnode as it is unsafe to return a
  referenced but unlocked denode.
2014-07-08 09:21:52 +00:00
hannken
4f7c01f703 CID 1223346: No need to check bp against NULL. It is always valid here. 2014-06-22 09:47:40 +00:00
hannken
11b42c4183 Unlock directory vnode after VOP_CREATE. 2014-06-17 12:38:12 +00:00
hannken
69110c4ec6 Change cd9660 from hashlist to vcache. 2014-06-16 09:55:49 +00:00
hannken
605674c009 Remove the hints "isodir" and "relocated" from cd9660_vget_internal()
and always reread the directory entry by inumber.  For directories
the directory entry is always its "." entry.

Always read directories via the device vnode to prevent buffer cache
inconsistency.  Keep i_devvp as a hint for fstat(1) and friends and
always use im_devvp for reads.  No need to vref()/vrele() i_devvp.

The additional bread is either cached because cd9660_lookup() just
released the buffer or will be used in the near future when the
directory gets traversed during lookup.

No objections on tech-kern@
2014-06-14 07:39:28 +00:00
pooka
a98adcf8d6 use psize_t for physical memory calculation 2014-06-13 11:57:48 +00:00
martin
b7650b1af5 Check for invalid mount arguments early and gracefully fail the mount.
Spotted by pooka@
2014-06-10 16:10:59 +00:00
martin
269c704651 Make sure to expand "freepages" to 64bit before shifting to byte values -
on rump we may have all our virtual address space "free".
Pointed out by pooka@.
2014-06-10 15:44:27 +00:00
martin
c7dd06b6bb Remove the hardcoded 4 MB free kernel memory limit and replace it
by uvmexp.freetarg, as discussed on tech-kern.
Main purpose is to make tmpfs usable (as far as possible) on small memory
machines.
This is a bit experimental, but we need to give it some real world exposure
to see how well it works.
2014-06-07 09:54:34 +00:00
joerg
11581dcbbb Introduce two helper functions to centralise the namecache statistics
in vfs_cache.c. Use consistent locking around the per-cpu data.
2014-06-03 19:30:29 +00:00
martin
755f765c3a PR kern/48815: do not skip ';' twice when comparing file versions.
Patch from Thomas Schmitt.
2014-06-01 11:01:18 +00:00
hannken
de57916f59 msdosfs_reclaim(): add missing fstrans and protect change
of v_data with v_interlock as msdosfs_sync() now needs it.
2014-05-30 08:42:35 +00:00
rmind
ce079fc9c0 tmpfs_mknod: it is not our responsibility to call vput() on the directory
vnode, so remove it (and ensure *vpp is NULL while here).
2014-05-26 19:12:07 +00:00
christos
202570e1e0 use macro. 2014-05-25 19:33:28 +00:00
christos
50f00297b4 use standard dirty vnode test. 2014-05-25 19:32:36 +00:00
hannken
e03668ca99 The pageflush_selector gets a vnode with v_interlock held.
Remove the mutex_enter()/mutex_exit() and simplify.

Hi christos...
2014-05-25 17:43:47 +00:00
christos
02cb0c6eaf Introduce a selector function to the vfs vnode iterator so that we don't
need to vget() vnodes that we are not interested at, and optimize locking
a bit. Iterator changes reviewed by Hannken (thanks), the rest of the bugs
are mine.
2014-05-24 16:34:03 +00:00
dholland
8e1257d82c Also set or assert that *vpp is null before calling VOP_MKDIR. 2014-05-17 04:07:15 +00:00
dholland
3955d2067a Set *vpp to NULL before calling VOP_CREATE. This always happens when
calling using nameidata, and if not something went wrong, so we'd like
to be able to assert about it.
2014-05-17 04:03:49 +00:00
martin
3638eee882 PR kern/48799: make filehandles properly use 64bit inodes on CD9660 file
systems. Patch from Thomas Schmitt, with slight modifications.
2014-05-13 17:05:26 +00:00
martin
b31205ebbb PR kern/48787: inode calculation from ISO9660 block offset might get
truncated to 32bit - force the whole expression to be evaluated as ino_t.
Patch from Thomas Schmitt, with minor modifications (and reworded comment).
2014-05-10 14:11:58 +00:00
christos
71fd41685f fix typo 2014-04-30 01:59:30 +00:00
christos
0172bc970f handle MNT_UPDATE 2014-04-30 01:33:51 +00:00
pooka
45fe388485 Don't lock an already locked vnode. 2014-04-25 15:18:06 +00:00
maxv
23f76b6d00 An (un)privileged user can easily make the kernel dereference a NULL
pointer.

The kernel allows 'data' to be NULL; it's the fs's responsibility to
ensure that it isn't NULL (if the fs actually needs data).

ok christos@
2014-04-16 18:55:17 +00:00
jakllsch
6d9f89fe00 Use size_t instead of int for character count to avoid sign compare issues. 2014-04-06 19:25:22 +00:00
christos
c636575468 Handle multiple ptyfs mounts with different chroots. ptys opened in one
chroot are only visible in that chroot.
2014-04-04 18:10:29 +00:00