Commit Graph

26 Commits

Author SHA1 Message Date
Rick Macklem
694a586a43 Add a lock flags argument to the VFS_FHTOVP() file system
method, so that callers can indicate the minimum vnode
locking requirement. This will allow some file systems to choose
to return a LK_SHARED locked vnode when LK_SHARED is specified
for the flags argument. This patch only adds the flag. It
does not change any file system to use it and all callers
specify LK_EXCLUSIVE, so file system semantics are not changed.

Reviewed by:	kib
2011-05-22 01:07:54 +00:00
John Baldwin
5b4f35a4f0 Merge comments about converting directory entries to be more direct and
concise.

Inspired by:	Gleb Kurtsou
2011-05-14 01:10:57 +00:00
Konstantin Belousov
4417ac326a Clarify the comment.
MFC after:	1 week
2011-04-30 13:49:03 +00:00
John Baldwin
7d74606889 Update a comment since ext2fs does not use SU.
Reviewed by:	kib
2011-04-28 20:25:15 +00:00
John Baldwin
466a71d75e The b_dep field of buffers is always empty for ext2fs, it is only used
for SU in FFS.

Reported by:	kib
2011-04-28 17:36:26 +00:00
John Baldwin
9e880b876d Sync with several changes in UFS/FFS:
- 77115: Implement support for O_DIRECT.
- 98425: Fix a performance issue introduced in 70131 that was causing
  reads before writes even when writing full blocks.
- 98658: Rename the BALLOC flags from B_* to BA_* to avoid confusion with
  the struct buf B_ flags.
- 100344: Merge the BA_ and IO_ flags so so that they may both be used in
  the same flags word. This merger is possible by assigning the IO_ flags
  to the low sixteen bits and the BA_ flags the high sixteen bits.
- 105422: Fix a file-rewrite performance case.
- 129545: Implement IO_INVAL in VOP_WRITE() by marking the buffer as
  "no cache".
- Readd the DOINGASYNC() macro and use it to control asynchronous writes.
  Change i-node updates to honor DOINGASYNC() instead of always being
  synchronous.
- Use a PRIV_VFS_RETAINSUGID check instead of checking cr_uid against 0
  directly when deciding whether or not to clear suid and sgid bits.

Submitted by:	Pedro F. Giffuni  giffunip at yahoo
2011-04-28 14:27:17 +00:00
John Baldwin
bbfe24fbf2 Use a private EXT2_ROOTINO constant instead of redefining ROOTINO.
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
2011-04-27 18:25:35 +00:00
John Baldwin
4d2ede6798 Various style fixes including using uint*_t instead of u_int*_t.
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
2011-04-27 18:15:34 +00:00
John Baldwin
056c6c933c Use ffs() to locate free bits in the inode and block bitmaps rather than
loops with bit shifts.
2011-02-24 22:11:36 +00:00
John Baldwin
73dd6d1f8f After reading a bitmap block for i-nodes or blocks, recheck the count of
free i-nodes or blocks to handle a race where another thread might have
allocated the last i-node or block while we were waiting for the buffer.

Tested by:	dougb
2011-02-08 13:02:25 +00:00
John Baldwin
a3ebd02675 Collapse duplicate definitions of EXT2_SB().
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
2011-02-04 14:20:27 +00:00
John Baldwin
8e42a40607 Fix build with DIAGNOSTIC enabled.
Pointy hat to:	jhb
2011-02-02 14:59:05 +00:00
John Baldwin
45641afb72 Some cosmetic fixes and remove a duplicate constant.
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
2011-02-01 18:30:52 +00:00
John Baldwin
c767faa558 - Set the next_alloc fields for an i-node after allocating a new block
so that future allocations start with most recently allocated block
  rather than the beginning of the filesystem.
- Fix ext2_alloccg() to properly scan for 8 block chunks that are not
  aligned on 8-bit boundaries.  Previously this was causing new blocks
  to be allocated in a highly fragmented fashion (block 0 of a file at
  lbn N, block 1 at lbn N + 8, block 2 at lbn N + 16, etc.).
- Cosmetic tweaks to the currently-disabled fancy realloc sysctls.

PR:		kern/153584
Discussed with:	bde
Tested by:	Pedro F. Giffuni  giffunip at yahoo, Zheng Liu (lz)
2011-02-01 18:21:45 +00:00
John Baldwin
cd2895aab0 - Move special inode constants to ext2_dinode.h and rename them to match
NetBSD.
- Add a constant for the HASJOURNAL compat flag.

PR:		kern/153584
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
2011-01-21 22:00:40 +00:00
John Baldwin
84edda0a2c Restore support for the 'async' and 'sync' mount options lost when
switching to nmount(2).  While here, sort the options.

PR:		kern/153584
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
MFC after:	1 week
2011-01-21 21:33:46 +00:00
John Baldwin
a2add8d070 Fix build with KDB defined.
Pointy hat to:	jhb
Submitted by:	jkim
2011-01-19 19:49:48 +00:00
John Baldwin
08b1d53573 Whitespace and style fixes. 2011-01-19 16:55:32 +00:00
John Baldwin
f82a066c72 Move calculation of 'bmask' earlier to match it's current location in
ufs_lookup().
2011-01-19 16:52:22 +00:00
John Baldwin
007c620744 Merge 118969 from UFS:
Eliminate the i_devvp field from the incore inodes, we can get the same
value from ip->i_ump->um_devvp.

Submitted by:	Pedro F. Giffuni  giffunip at yahoo
MFC after:	1 week
2011-01-19 16:46:13 +00:00
Konstantin Belousov
730b63b0c2 Remove prtactive variable and related printf()s in the vop_inactive
and vop_reclaim() methods. They seems to be unused, and the reported
situation is normal for the forced unmount.

MFC after:   1 week
X-MFC-note:  keep prtactive symbol in vfs_subr.c
2010-11-19 21:17:34 +00:00
Ulf Lilleengen
0cc17ce608 - Remove duplicate comment.
PR:		kern/148820
Submitted by:	pluknet <pluknet - at - gmail.com>
2010-09-01 05:34:17 +00:00
Edward Tomasz Napierala
b5f770bd86 Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize().
Reviewed by:	kib
2010-05-05 16:44:25 +00:00
Ulrich Spörlein
8fa03d08ca Fix common misspelling of hierarchy
Pointed out by:		bf1783 at gmail
Approved by:		np (cxgb), kientzle (tar, etc.), philip (mentor)
2010-02-20 10:19:19 +00:00
Ulf Lilleengen
2ab38c399e Revert parts of r202283:
- Return EOPNOTSUPP before EROFS to be consistent with other filesystems.
- Fix setting of the nodump flag for users without PRIV_VFS_SYSFLAGS privilege.

Submitted by:	jh@
2010-01-18 19:09:16 +00:00
Ulf Lilleengen
e09c00cada Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summer
of Code 2009:

- BSDL block and inode allocation policies for ext2fs. This involves the use
  FFS1 style block and inode allocation for ext2fs. Preallocation was removed
  since it was GPL'd.
- Make ext2fs MPSAFE by introducing locks to per-mount datastructures.
- Fixes for kern/122047 PR.
- Various small bugfixes.
- Move out of gnu/ directory.

Sponsored by:   Google Inc.
Submitted by:	Aditya Sarawgi <sarawgi.aditya AT SPAMFREE gmail DOT com>
2010-01-14 14:30:54 +00:00