Commit graph

1152 commits

Author SHA1 Message Date
Poul-Henning Kamp bc9d8a9a37 Fix comments and one resulting code confusion about the type of the
"command" argument to VOP_IOCTL.

Spotted by:	FlexeLint.
2002-10-16 08:04:11 +00:00
Poul-Henning Kamp fcf549422d Be consistent about functions being static.
Spotted by:	FlexeLint
2002-10-16 08:00:32 +00:00
Poul-Henning Kamp 4cfe209335 A better solution to avoiding variable sized structs in DEVFS. 2002-10-16 07:51:18 +00:00
Poul-Henning Kamp c122d758ca #include "opt_devfs.h" to protect against variable sized structures.
Spotted by:	FlexeLint
2002-10-16 07:16:47 +00:00
Poul-Henning Kamp 65a728a53b Plug an infrequent (I think) memory leak.
Spotted by:	FlexeLint
2002-10-15 18:51:02 +00:00
Kirk McKusick a5b65058d5 Regularize the vop_stdlock'ing protocol across all the filesystems
that use it. Specifically, vop_stdlock uses the lock pointed to by
vp->v_vnlock. By default, getnewvnode sets up vp->v_vnlock to
reference vp->v_lock. Filesystems that wish to use the default
do not need to allocate a lock at the front of their node structure
(as some still did) or do a lockinit. They can simply start using
vn_lock/VOP_UNLOCK. Filesystems that wish to manage their own locks,
but still use the vop_stdlock functions (such as nullfs) can simply
replace vp->v_vnlock with a pointer to the lock that they wish to
have used for the vnode. Such filesystems are responsible for
setting the vp->v_vnlock back to the default in their vop_reclaim
routine (e.g., vp->v_vnlock = &vp->v_lock).

In theory, this set of changes cleans up the existing filesystem
lock interface and should have no function change to the existing
locking scheme.

Sponsored by:	DARPA & NAI Labs.
2002-10-14 03:20:36 +00:00
Maxime Henrion 15f6504832 - Remove a useless initialization for 'ronly', if it hadn't been
there, we would have noticed that 'ronly' was uninitialized :-).
- Kill a nearby 'register' keyword.
2002-10-13 16:13:11 +00:00
Poul-Henning Kamp 2afdbfe1e6 Pass flags to VOP_CLOSE() corresponding to what was passed to VOP_OPEN().
Submitted by:	"Peter Edwards" <pmedwards@eircom.net>
2002-10-13 16:04:46 +00:00
Mike Barcroft 2b7f24d210 Change iov_base's type from char *' to the standard void *'. All
uses of iov_base which assume its type is `char *' (in order to do
pointer arithmetic) have been updated to cast iov_base to `char *'.
2002-10-11 14:58:34 +00:00
Dima Dorfman e5d09546b8 Treat the pathptrn field as a real pattern with the aid of fnmatch(). 2002-10-08 04:21:54 +00:00
Maxime Henrion 20c544dbdf Yet another 64 bits warning fix: s/u_int/size_t/. 2002-10-06 12:07:58 +00:00
Maxime Henrion 0b3bf442a1 Fix a warning on 64 bits platforms: copyinstr() takes
a size_t *, not an u_int *.
2002-10-06 11:45:22 +00:00
Maxime Henrion a8f15ed745 Fix a warning on 64 bits platforms: copystr() takes a size_t *,
not an int *.
2002-10-06 11:42:14 +00:00
Robert Watson 74e62b1b75 Integrate a devfs/MAC fix from the MAC tree: avoid a race condition during
devfs VOP symlink creation by introducing a new entry point to determine
the label of the devfs_dirent prior to allocation of a vnode for the
symlink.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-05 18:40:10 +00:00
Poul-Henning Kamp 00ab1355ab Plug memoryleaks detected by FlexeLint. 2002-10-05 12:00:11 +00:00
Juli Mallett 1d9c56964d Back our kernel support for reliable signal queues.
Requested by:	rwatson, phk, and many others
2002-10-01 17:15:53 +00:00
Poul-Henning Kamp 2c5e1d1e6f Move the vop-vector declaration into devfs_vnops.c where it belongs. 2002-10-01 10:08:08 +00:00
Juli Mallett 5cd192f4b2 When working with sigset_t's, and needing to perform masking operations based
on a process's pending signals, use the signal queue flattener,
ksiginfo_to_sigset_t, on the process, and on a local sigset_t, and then work
with that as needed.
2002-10-01 02:49:28 +00:00
Juli Mallett 1226f694e6 First half of implementation of ksiginfo, signal queues, and such. This
gets signals operating based on a TailQ, and is good enough to run X11,
GNOME, and do job control.  There are some intricate parts which could be
more refined to match the sigset_t versions, but those require further
evaluation of directions in which our signal system can expand and contract
to fit our needs.

After this has been in the tree for a while, I will make in kernel API
changes, most notably to trapsignal(9) and sendsig(9), to use ksiginfo
more robustly, such that we can actually pass information with our
(queued) signals to the userland.  That will also result in using a
struct ksiginfo pointer, rather than a signal number, in a lot of
kern_sig.c, to refer to an individual pending signal queue member, but
right now there is no defined behaviour for such.

CODAFS is unfinished in this regard because the logic is unclear in
some places.

Sponsored by:	New Gold Technology
Reviewed by:	bde, tjr, jake [an older version, logic similar]
2002-09-30 20:20:22 +00:00
Poul-Henning Kamp 19ebba326b s/struct dev_t */dev_t */ 2002-09-28 21:21:01 +00:00
Poul-Henning Kamp 562c866822 Fix mis-indent. 2002-09-28 17:37:55 +00:00
Poul-Henning Kamp 37c841831f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
Poul-Henning Kamp d241c36453 I misplaced a local variable yesterday. 2002-09-28 13:42:04 +00:00
Poul-Henning Kamp 2e27173fb5 Add a D_NOGIANT flag which can be set in a struct cdevsw to indicate
that a particular device driver is not Giant-challenged.

SPECFS will DROP_GIANT() ... PICKUP_GIANT() around calls to the
driver in question.

Notice that the interrupt path is not affected by this!

This does _NOT_ work for drivers accessed through cdevsw->d_strategy()
ie drivers for disk(-like), some tapes, maybe others.
2002-09-27 19:47:59 +00:00
Poul-Henning Kamp ca916247cd Rename struct specinfo to the more appropriate struct cdev.
Agreed on:	jake, rwatson, jhb
2002-09-27 18:27:10 +00:00
Poul-Henning Kamp 48a7c35e51 I hate it when patch gives me .rej files.
Can't we make the pre-commit check refuse if there are .rej files in
the directory ?
2002-09-26 17:25:22 +00:00
Poul-Henning Kamp c2aee6b42d Return ENOTTY on unhandled ioctls. 2002-09-26 14:11:49 +00:00
Poul-Henning Kamp 1d02d910c1 Return ENOTTY on unrecognized ioctls. 2002-09-26 14:08:37 +00:00
Poul-Henning Kamp f6b80a4921 Return ENOTTY on incorrect ioctls. 2002-09-26 14:07:43 +00:00
Poul-Henning Kamp 2917ba13f7 Return ENOTTY when we don't recognize an ioctl. 2002-09-26 14:05:36 +00:00
Nate Lawson 5187d555a5 Fix these warns where sizeof(int) != sizeof(void *)
/h/des/src/sys/coda/coda_venus.c: In function `venus_ioctl':
/h/des/src/sys/coda/coda_venus.c:277: warning: cast from pointer to integer of
different size
/h/des/src/sys/coda/coda_venus.c:292: warning: cast from pointer to integer of
different size
/h/des/src/sys/coda/coda_venus.c: In function `venus_readlink':
/h/des/src/sys/coda/coda_venus.c:380: warning: cast from pointer to integer of
different size
/h/des/src/sys/coda/coda_venus.c: In function `venus_readdir':
/h/des/src/sys/coda/coda_venus.c:637: warning: cast from pointer to integer of
different size

Submitted by:	des-alpha-tinderbox
2002-09-26 06:19:31 +00:00
Jeff Roberson 2a96b2d69f - Fix a botch in previous commit; oldvp should not be unconditionally
assigned.
2002-09-26 02:54:30 +00:00
Semen Ustimenko 7dcd8ef946 Fix the problem introduced by vop_stdbmap() usage. The NTFS does not
implement worthful VOP_BMAP() handler, so it expect the blkno not to be
changed by VOP_BMAP(). Otherwise, it'll have to find some tricky way to
determine if bp was VOP_BMAP()ed or not in VOP_STRATEGY().

PR:		kern/42139
2002-09-25 23:55:06 +00:00
Jeff Roberson 37ab0e0d81 - Use vrefcnt() instead of v_usecount. 2002-09-25 02:42:43 +00:00
Jeff Roberson 9026179755 - Use vrefcnt() instead of directly accessing v_usecount. 2002-09-25 02:33:29 +00:00
Jeff Roberson 4d93c0be1f - Use vrefcnt() where it is safe to do so instead of doing direct and
unlocked accesses to v_usecount.
 - Lock access to the buf lists in the various sync routines.  interlock
   locking could be avoided almost entirely in leaf filesystems if the
   fsync function had a generic helper.
2002-09-25 02:32:42 +00:00
Jeff Roberson c944ebed73 - Lock access to the buf lists in spec_sync()
- Fixup interlock locking in spec_close()
2002-09-25 02:29:49 +00:00
Jeff Roberson 75cabb639a - Hold the vp lock while accessing v_vflags. 2002-09-25 02:28:07 +00:00
Alfred Perlstein 4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
Ian Dowse ac11ad13fb Attempt to fix the error reported by the alpha tinderbox. A pointer
was being cast to an integer as part of a hash function, so just
add an intptr_t cast to silence the warning.
2002-09-22 13:25:57 +00:00
Don Lewis 1c4ccf09cd Fix misspellings, capitalization, and punctuation in comments. Minor
comment phrasing and style changes.
2002-09-22 08:54:17 +00:00
Jake Burkholder 05ba50f522 Use the fields in the sysentvec and in the vm map header in place of the
constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS.
This is mainly so that they can be variable even for the native abi, based
on different machine types.  Get stack protections from the sysentvec too.
This makes it trivial to map the stack non-executable for certain abis, on
machines that support it.
2002-09-21 22:07:17 +00:00
Don Lewis fa288043e2 VOP_FSYNC() requires that it's vnode argument be locked, which nfs_link()
wasn't doing.  Rather than just lock and unlock the vnode around the call
to VOP_FSYNC(), implement rwatson's suggestion to lock the file vnode
in kern_link() before calling VOP_LINK(), since the other filesystems
also locked the file vnode right away in their link methods.  Remove the
locking and and unlocking from the leaf filesystem link methods.

Reviewed by:	rwatson, bde  (except for the unionfs_link() changes)
2002-09-19 13:32:45 +00:00
Nate Lawson 86ed6d45ac Remove any VOP_PRINT that redundantly prints the tag.
Move lockmgr_printinfo() into vprint() for everyone's benefit.

Suggested by: bde
2002-09-18 20:42:04 +00:00
Boris Popov 44f3878ecb Always open file in the DENYNONE mode and let the server to decide what is
good for this file.
This should allow read only access to file which is already opened on server.
2002-09-18 09:54:16 +00:00
Boris Popov 3c2f5c3cc8 Implement additional SMB calls to allow proper update of file size as some
file servers fail to do it in the right way.

New NFLUSHWIRE flag marks pending flush request(s).

NB: not all cases covered by this commit.

Obtained from:	Darwin
2002-09-18 09:27:04 +00:00
Nate Lawson 06be2aaa83 Remove all use of vnode->v_tag, replacing with appropriate substitutes.
v_tag is now const char * and should only be used for debugging.

Additionally:
1. All users of VT_NTS now check vfsconf->vf_type VFCF_NETWORK
2. The user of VT_PROCFS now checks for the new flag VV_PROCDEP, which
is propagated by pseudofs to all child vnodes if the fs sets PFS_PROCDEP.

Suggested by:   phk
Reviewed by:    bde, rwatson (earlier version)
2002-09-14 09:02:28 +00:00
Julian Elischer 71fad9fdee Completely redo thread states.
Reviewed by:	davidxu@freebsd.org
2002-09-11 08:13:56 +00:00
David Xu 1279572a92 s/SGNL/SIG/
s/SNGL/SINGLE/
s/SNGLE/SINGLE/

Fix abbreviation for P_STOPPED_* etc flags, in original code they were
inconsistent and difficult to distinguish between them.

Approved by: julian (mentor)
2002-09-05 07:30:18 +00:00
Ian Dowse 4cf64ccaed Add a missing #include <sys/lockmgr.h>. 2002-09-01 23:02:10 +00:00