Commit Graph

1652 Commits

Author SHA1 Message Date
maxv
8dfa44bc87 Small cleanup:
- KNF
 - malloc + memset -> malloc(|M_ZERO)
 - no need to check data == NULL
2014-12-29 17:17:54 +00:00
maxv
6a89606711 I started to KNF this file but quickly ended up figuring out I was not
courageous enough for such ugliness. So I only KNF'ed the first 300
lines.

I'll come back later.
2014-12-29 17:02:39 +00:00
maxv
0f13b9e40d Typos:
- "nessesary" -> "necessary" (comment)
 - "UNEXISTED" -> "NON-EXISTENT" (dprintf)
 - "NON-EXISTANT" -> "NON-EXISTENT" (dprintf)
 - "reach" -> "reaches" (comment)
2014-12-29 16:37:27 +00:00
hannken
9837a8c2e9 Change v7fs to vcache. 2014-12-29 15:29:38 +00:00
hannken
b1a3c148f6 Defer deallocating unlinked inodes to v7fs_reclaim().
Remove v7fs_vnode_reload() and always use v7fs_inode_load().  No need
to search for a vnode we already hold a reference on.
2014-12-29 15:28:58 +00:00
hannken
2d6e8595d5 v7fs_getattr: adjust size of symlinks by -1 to compensate the trailing NUL.
Should fix the v7fs part of PR kern/48864.
2014-12-29 15:28:08 +00:00
maxv
6387e6748f Make this more readable (KNF). 2014-12-28 14:42:56 +00:00
maxv
fc8f062e48 Prevent another division by zero in ntfs_loadntnode() by ensuring
spc != 0.
2014-12-28 13:11:52 +00:00
maxv
c1acce042f Ensure bps != 0 to prevent a division by zero. Zero byte per sector makes
no sense.
2014-12-28 12:57:44 +00:00
maxv
6d178278b3 Two typos:
- reserver4 -> reserved4 (in struct bootfile)
 - "inducates" -> "indicates" (comment)
2014-12-28 12:19:21 +00:00
maxv
ead51937de Make this more readable (KNF). 2014-12-28 12:13:22 +00:00
hannken
a9354f199f Change sysvbfs to vcache. 2014-12-26 15:23:21 +00:00
hannken
1ad4902933 Sysvbfs_rename: Call bfs_file_delete(bfs, to_name, true) before calling
bfs_file_rename() and remove the bfs_file_delete() from bfs_file_rename().

After calling bfs_file_rename() it was too late to set "tnode->removed"
as the inode already disappeared.
2014-12-26 15:22:15 +00:00
hannken
b34528880c Change smbfs from hashlist to vcache.
- Use (parent_vnode, name, name_len) as key.
- Change smbfs_nget() to return a referenced but unlocked vnode and
  adapt smbfs_setroot(), smbfs_create(), smbfs_mkdir() and smbfs_lookup().
2014-12-21 10:48:53 +00:00
justin
0e9af57062 Simplify control flow
Removes a variable and compiler warnings in some cases.
2014-12-07 23:48:04 +00:00
reinoud
65b5af65e0 Explicitly delete the failing node; it would be killed with the unlink too but
explicitly deleting it is better than just setting the file size to zero.
2014-12-03 21:37:55 +00:00
reinoud
a2b485ee86 Relax the KASSERT since an equal size is no issue 2014-12-03 21:34:55 +00:00
nakayama
687aa18d14 Avoid use after pool_put. 2014-11-25 12:33:13 +00:00
christos
53bfb03cf5 make this compile again. 2014-11-17 02:23:33 +00:00
christos
a95736d447 PR/49207: Kamil Rytarowski: Add sys/clock.h with generic time macros
(derived from clock_subr.h). Keep clock_subr.h with the kernel structures
and functions to reduce diffs, and have clock.h only include standalone
constants and macros.
2014-11-17 02:15:48 +00:00
nakayama
8c1c14022f Adjust smbfs/netsmb for filenames byte length changes that come as
a result of iconv conversion.  Most codes are taken from FreeBSD.
2014-11-15 18:52:44 +00:00
hannken
0bac62655e Change ntfs to vcache.
- Use (inumber, attrtype, attrname) as key.
- Inline ntfs_fget() and ntfs_frele() as they only get called once.
2014-11-13 16:51:53 +00:00
hannken
a26eea283a - Change ntfs_vgetex() to always load the ntnode and fnode.
- Take the vnode attributes from the NAME attribute.
- Remove now unused ntfs_times() and ntfs_filesize().
- Treat nodes without an unnamed DATA attribute as zero-sized regular files.
2014-11-13 16:51:10 +00:00
hannken
6f8e2ffe40 - Fix ntfs_ntlookupattr() to make the examples from the man page work.
- Fix ntfs_loadntnode() to always read full cluster to prevent buffer
  cache inconsistency.
- Change ntfs_vgetex() and ntfs_fget() to take a const attrname and
  always pass a possibly empty string.
- Change printf to dprintf.
- Get rid of dead fields i_next, i_prev of struct ntnode.
2014-11-13 16:49:56 +00:00
riz
28fe942ff2 Revert previous, it is actually needed. (builds are failing) 2014-11-10 19:44:08 +00:00
maxv
fcc99ce60e Do not uselessly include <sys/malloc.h>. 2014-11-10 18:46:33 +00:00
nakayama
bf71b4294d Fix vnode locking changes in rev.1.89:
- lock vnode by the end of cache_purge and vput.
2014-11-07 12:05:58 +00:00
manu
0c81f4b006 PUFFS direct I/O cache fix
There are a few situations where we must take care of the cache if direct
I/O was enabled:
- if we do direct I/O for write but not for read, then any write must
  invalidate the cache so that a reader gets the written data and not
  the not-updated cache.
- if we used a vnode without direct I/O and it is enabled for writing,
  we must flush the cache before compeling the open operation, so that
  the cachec write are not lost.

And at inactive time, we wipe direct I/O flags so that a new open without
direct I/O does not inherit direct I/O.
2014-11-04 09:14:42 +00:00
manu
17036f29cb Fix PUFFS node use-after-reclaim
When puffs_cookie2vnode() misses an entry, vcache_get()
creates a new node (puffs_vfsop_loadvnode being called to
initialize the PUFFS part), then it discovers it is VNON,
and tries to vrele() it. vrele() calls VOP_INACTIVE(),
which led us in puffs_vnop_inactive() where we sent a
request to the filesystem for a node that already had been
reclaimed.

The fix is to check for VNON nodes in puffs_vnop_inactive()
and to return without doing anyting. This is suboptimal, but
a better workaround would probably need to modify vcache API,
with an impact on other filesystems. Let us keep it simple.
2014-11-04 09:10:37 +00:00
manu
962cb9b884 Add PUFFS_HAVE_FALLOCATE in puffs_msgif.h so that filesystem can decide
at build time wether fallocate is usable
2014-10-31 14:20:54 +00:00
manu
78fa995d09 Add PUFFS support for fallocate and fdiscard operations 2014-10-31 13:52:41 +00:00
manu
ef586c84dd According to pooka@'s comment, a long time ago, VOP_STRATEGY could not
fail without taking down the kernel. It seems this is not the case anymore,
hence we can stop dropping errors in puffs_vnop_strategy()

Approved by pooka@
2014-10-31 13:51:33 +00:00
christos
2d22a4aaac Revert previous; it does not work with COMPAT_BSDPTY, screen(1) fails because
it does a TIOCPTSNAME immediately after opening ptmx and finds an old style pty.
2014-10-21 16:05:01 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos
14b4a4b149 From Ilia Zykov:
- correct some incorrect comments
- add XXX warning
- increase security by activating when get the slave
- make pty_vn_open() private to tty_ptm.c
2014-10-15 15:00:03 +00:00
hannken
668c7daae4 Change nilfs to vcache. 2014-10-15 09:05:46 +00:00
hannken
52473f33d5 Prepare nilfs for vcache:
- Calling getnewvnode() with "mp == NULL" is wrong.  Stop attaching a
  vnode to system file nodes and change nilfs_bread() to translate
  the block address and then uyse the device for the read.
- Move the vnode initialisation to nilfs_get_node() and use
  nilfs_get_node_raw() to initialise the nilfs node only.
- Same for nilfs_reclaim() versus nilfs_dispose_node().
- Change nilfs_get_node() to return an unlocked vnode instead of
  a nilfs node with locked vnode.  Adapt nilfs_lookup() and nilfs_root().
- Don't treat unsupported node types (blk, chr ...) as regular,
  return ENXIO instead.
- Fix nilfs_getattr() to mask the mode with ALLPERMS.
- Destroy sync_cv before free.
2014-10-15 09:03:53 +00:00
uebayasi
fe9a32c84e Define filesystem attributes with vfs dependency. 2014-10-11 06:42:18 +00:00
he
89a215e851 Do the previous correctly... 2014-10-07 12:58:09 +00:00
he
d01de6e07a As is evidenced by several of our 32-bit MIPS ports, it's wrong to
print vsize_t with PRIx64 -- instead use our own PRIxVSIZE macro.
2014-10-07 11:37:06 +00:00
he
60c92b53ed Make this build again without debugging enabled; DPRINTF() can end up
as empty, and in an if conditional, you then need braces if that's the
only potential body.
2014-10-06 14:26:44 +00:00
manu
4cb6f55f7a Retore LP64 fix that was removed by mistake 2014-10-06 09:05:55 +00:00
manu
0671358a48 Improve zero-fill of last page after shrink fix:
1) do it only if the file is open for writing, otherwise we send write
requests to the FS on a file that has never been open.
2) do it inside existing if (vap->va_size != VNOVAL) block
2014-10-06 04:41:59 +00:00
apb
15239241e8 Add close brace, accidentally omitted from previous change. 2014-10-05 20:40:46 +00:00
apb
f1dbec9add Safer definitions of DPRINTF and DPRINTF_VERBOSE.
In the PUFFSDEBUG case, wrap do { ... } while (/*CONSTCOND*/0)
around the definitions.  In the non-PUFFSDEBUG case, define them
as ((void)0) instead of as empty.
2014-10-05 14:13:14 +00:00
justin
bc648e4794 Use PRIx64 for printing offsets 2014-10-05 09:28:24 +00:00
manu
2a5ce25ed0 If we truncate the file, make sure we zero-fill the end of the last
page, otherwise if the file is later truncated to a larger size
(creating a hole), that area will not return zeroes as it should.
2014-10-05 07:53:22 +00:00
hannken
e716e7d8d6 Change filecore to vcache.
Compile-tested only, was not able to get my hands on a readable fs image.
2014-10-04 13:27:24 +00:00
hannken
f401fa494c Fix the puffs_sop_thread -> puffs_cookie2vnode path:
- pass the cookie by reference
- add missing mutex_exit()
- update assertion for VNON typed vnodes
2014-09-30 10:15:03 +00:00
reinoud
ef40ac265a Fix bug introduced in last patch 2014-09-17 21:18:43 +00:00