Commit Graph

1956 Commits

Author SHA1 Message Date
skrll
94a59cc1db Remove some set but unused variables 2013-04-08 21:12:33 +00:00
plunky
5ec364d4d9 C99 section 6.7.2.3 (Tags) Note 3 states that:
A type specifier of the form

	enum identifier

  without an enumerator list shall only appear after the type it
  specifies is complete.

which means that we cannot pass an "enum vtype" argument to
kauth_access_action() without fully specifying the type first.
Unfortunately there is a complicated include file loop which
makes that difficult, so convert this minimal function into a
macro (and capitalize it).

(ok elad@)
2013-03-18 19:35:35 +00:00
dholland
dcd34a91c5 Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.
2013-01-22 09:39:11 +00:00
hannken
312d89f0de Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
2012-12-20 08:03:41 +00:00
manu
591c7f2eaa Remove always-true condition and note that the current code is suboptimal. 2012-12-08 13:42:36 +00:00
mbalmer
0b522e92f1 Fix a typo in debug output. 2012-12-01 11:31:01 +00:00
drochner
9d483431fd allow to enable ffs "discard" by update mounts, make the flag visible
to userland
2012-11-26 16:22:21 +00:00
jakllsch
4ca1f26828 Write support for the Ext4 Read-only Compatible Feature "huge_file".
Primarily, this feature extends the inode block count field to 48 bits.
Additionally, this feature allows this field to be represented in file
system block size units rather than DEV_BSIZE units.
2012-11-21 23:11:23 +00:00
jakllsch
26f3fbc515 Add various newer Ext2 superblock feature bits and inode flag bits. 2012-11-21 20:45:35 +00:00
jakllsch
762844de5e snprintb EXT2F_ROCOMPAT_SPARSESUPER as such. 2012-11-19 03:04:23 +00:00
jakllsch
59134e0eef - Add e2di_version, e2di_nblock_high, e2di_facl_high fields to ext2fs_dinode.
- Update i_e2fs_ aliases to match.

- ext2fs_bswap support for these ext2fs_dinode fields.

(e2di_version and e2di_facl_high replace previously reserved fields.
e2di_nblock_high was formerly e2di_nfrag and e2di_fsize, however these
are currently defined in e2fsprogs as only being relevant for HURD.)
2012-11-19 00:36:21 +00:00
jakllsch
d3a7475d25 Move i_e2fs_rdev define to be adjacent to the field it aliases. 2012-11-19 00:25:29 +00:00
jakllsch
1703ea9991 stylistic adjustment in comments 2012-11-18 18:20:56 +00:00
jakllsch
990c973d65 correct comment to match code 2012-11-18 17:59:56 +00:00
jakllsch
ef276a54b7 Match prototype types to function types (u_int64_t vs. uint64_t). 2012-11-17 16:03:48 +00:00
dholland
35ed690545 Excise struct componentname from the namecache.
This uglifies the interface, because several operations need to be
passed the namei flags and cache_lookup also needs for the time being
to be passed cnp->cn_nameiop. Nonetheless, it's a net benefit.

The glop should be able to go away eventually but requires structural
cleanup elsewhere first.

This change requires a kernel bump.
2012-11-05 17:27:37 +00:00
dholland
1617a81dd1 Disentangle the namecache from the internals of namei.
- Move the namecache's hash computation to inside the namecache code,
instead of being spread out all over the place. Remove cn_hash from
struct componentname and delete all uses of it.

 - It is no longer necessary (if it ever was) for cache_lookup and
cache_lookup_raw to clear MAKEENTRY from cnp->cn_flags for the cases
that cache_enter already checks for.

 - Rearrange the interface of cache_lookup (and cache_lookup_raw) to
make it somewhat simpler, to exclude certain nonexistent error
conditions, and (most importantly) to make it not require write access
to cnp->cn_flags.

This change requires a kernel bump.
2012-11-05 17:24:09 +00:00
drochner
5724e77fda Implement experimental support to pass notifications that a file
was deleted from the filesystem to the disk driver, commonly
known as "discard" or "trim".
fs/driver support is in ffs and ata wd for now.
This is what was posted here:
http://mail-index.netbsd.org/tech-kern/2012/02/28/msg012813.html
with minor cleanup, and the global switch replaced by a mount option.
2012-10-19 17:09:06 +00:00
ttoth
bca84b9e1f CHFS comments 2012-10-19 12:44:39 +00:00
dholland
6c1de0eff5 Add an XXX comment about a broken error case in ufs_dirremove.
(this was in one of my old rename patches)
2012-10-14 23:57:32 +00:00
bouyer
a2d3f5532c Fix quota2 list corruption issue when defaultquotas are 0 (deny any file
and block allocation).

When quota2_check() is called with an uid not yet in the list,
getinoquota2() will call quota2_q2ealloc() to allocate a new entry for this
uid. quota2_q2ealloc() will remove an entry from the free list and
put it at the head of the corresponding hash list, and flush the block
containing the header if it's not the one also containing the allocated entry.
quota2_q2ealloc() then return the alocated entry and corresponding block
to caller (getinoquota2() here), which returns it to quota2_check().
quota2_check() then checks if the allocation can succeed, and returns and
error if not and calls brelse() on the buffer (because from his POW no
change was made to the entry), effectively discarding changes
to the entry that may have been made by quota2_q2ealloc().
Fix by always bwrite()ing the entry in quota2_q2ealloc(), and re-reading
the entry in caller.
2012-09-27 07:47:56 +00:00
manu
dbb40afdd6 Fix unmount returnign EBUSY if an attribute was autocreated: we hold
a useless reference that we never gave back
2012-09-10 14:00:15 +00:00
manu
73a4ed62d1 Stop extended attributes at the appropriate place so that unmount
does not fail with EBUSY on filesystem with extended attributes ensabled.
2012-09-10 07:57:50 +00:00
manu
bd4473d64d Temporary fix for quotactl authorization: it must use the effective UID
and not the real UID.

Further work is required to move the check to the kauth listener instead
of having it in UFS code.
2012-09-09 04:27:49 +00:00
christos
56494a63c4 really print the incompatible bits. 2012-09-01 17:01:24 +00:00
chs
e17cae4e52 when failing a mount due to unsupported features,
print which features are involved.
2012-09-01 15:46:11 +00:00
dholland
6f1deef47f Move INITQFNAMES to the right header file. 2012-08-26 02:32:14 +00:00
ttoth
621ca7dac4 chfs: uappnd flag patch 2012-08-23 11:29:51 +00:00
ttoth
8a77fce611 chfs: fixed truncating 2012-08-22 09:20:13 +00:00
ttoth
36435346bd chfs fixes
1. nodes are obsoleted only once during truncating a file
2. frags don't stay in pool_cache
2012-08-13 13:12:51 +00:00
ttoth
3fae61ee8c chfs bugfix [node was obsoleted twice] 2012-08-10 09:26:58 +00:00
dholland
25f0cf9440 Restore accidentally lost initialization of quotatypes[].
Fixes (null) in the kernel message triggered when you go over quota, and
maybe other things. Reported by Matthew Mondor.
2012-07-29 08:32:27 +00:00
rmind
d65753d972 Move some the test for MAKEENTRY into the cache_enter(9). Make some
variables in vfs_cache.c static, __read_mostly, etc.

No objection on tech-kern@.
2012-07-22 00:53:18 +00:00
matt
7d217c32d0 Convert a KDASSERT to a KDASSERTMSG 2012-07-09 11:20:22 +00:00
riastradh
482b8291f9 Use two separate comments for stub where IN_RENAME was. 2012-06-04 22:01:07 +00:00
riastradh
b8c3b27f99 Kill the IN_RENAME in-core inode flag in ufs and ext2fs.
Now that rename works we need not to wave this sort of voodoo at it.

ok dholland
2012-06-04 20:13:47 +00:00
riastradh
93765c12f0 Fix typo in comment: bp->b_bcount, not bp->b_count. 2012-06-04 19:58:57 +00:00
riastradh
2881e7e069 Fix ext2fs's scary cross-block directory message too.
(See rev. 1.3 of sys/ufs/ufs/ufs_rename.c for the analysis.)
2012-06-04 19:45:59 +00:00
riastradh
487d92ffe0 Kill scary message about cross-block directories and fix its cause.
Add a bunch of kasserts to check more stringently that ufs_direnter
did not compact across directory blocks.  Don't bother fetching
subsequent I/O blocks from the directory: ufs_lookup guarantees that
it's not necessary, and the kasserts check this to be sure.

The message fired when we were looking at the start of an I/O block,
not when we crossed from the end of one to the start of another.  I
believe it fired only when tulr->ulr_offset was a multiple of the I/O
block size (fs_bsize), which can happen if ufs_lookup either finds an
entry or finds free space at the start of an I/O block.

If ufs_lookup found an entry, none of this ulr recalculation logic
should kick in -- if tvp != NULL, then tulr->ulr_count is garbage, so
it's not merely unnecessary but wrong (although I suspect harmless in
the end) to read it in ufs_rename_overlap_p in consideration of
whether to recalculate fulr.

Discussed with chuq and dholland.

ok dholland
2012-06-04 19:37:36 +00:00
riastradh
3ce4df2ac9 Tidy up some typos and vestiges in comments after the ulr changes. 2012-06-04 16:46:45 +00:00
riastradh
d9d99dd6dc Swap byte order of ext2fs_direct fields in ext2fs_rename_recalculate_fulr.
Symptom found and fix tested by martin.

ok martin
2012-05-10 19:08:34 +00:00
riastradh
dae16d94fa Disable scary but probably harmless printf.
Still need to find why this harmless-but-shouldn't-happen case is
happening, but in the mean time, we can stop scaring people with it.
2012-05-10 07:57:02 +00:00
riastradh
aeadee1d6d Adapt ffs, lfs, and ext2fs to use genfs_rename.
ok dholland, rmind
2012-05-09 00:21:17 +00:00
yamt
9b10dd1106 comments and cosmetics. no functional changes. 2012-05-05 04:08:53 +00:00
manu
7f8940a8ce Return ENODATA when no attribute is found, like Linux does. After
all we decided to adopt the Linux API, therefore there is rationale
to stick to it.

No standard tells us what to do, and our extended attribute API has not
been used in a release, therefore we do not break anything, and we get
more easily compatible with programs using the Linux extended attribute
API.

Note that FreeBSD and MacOS X return ENOATTR. FreeBSD has its own API
and MacOS X has a Linux-like API. How did the world get so complicated?
2012-05-01 07:48:25 +00:00
rmind
f1d428af19 - Replace some malloc(9) uses with kmem(9).
- G/C M_IPMOPTS, M_IPMADDR and M_BWMETER.
2012-04-30 22:51:27 +00:00
chs
8306a9eddf change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
2012-04-29 22:53:59 +00:00
drochner
de54f242ed everywhere else it is assumed that the filesystem block size fits into
a 32-bit "int" -- do the cast to quell a compiler warning in a more
sensible way
2012-04-23 17:19:00 +00:00
christos
fe0d6a4e66 one more cast 2012-04-20 02:07:43 +00:00
christos
99b2fa090d Fix signed/unsigned issues. 2012-04-19 17:25:38 +00:00