summaryrefslogtreecommitdiffstats
path: root/sys/fs/portalfs
Commit message (Collapse)AuthorAgeFilesLines
* Make insmntque() externally visibile and allow it to fail (e.g. duringtegge2007-03-132-0/+12
| | | | | | | | | | | | | | | | | | | | | | | late stages of unmount). On failure, the vnode is recycled. Add insmntque1(), to allow for file system specific cleanup when recycling vnode on failure. Change getnewvnode() to no longer call insmntque(). Previously, embryonic vnodes were put onto the list of vnode belonging to a file system, which is unsafe for a file system marked MPSAFE. Change vfs_hash_insert() to no longer lock the vnode. The caller now has that responsibility. Change most file systems to lock the vnode and call insmntque() or insmntque1() after a new vnode has been sufficiently setup. Handle failed insmntque*() calls by propagating errors to callers, possibly after some file system specific cleanup. Approved by: re (kensmith) Reviewed by: kib In collaboration with: kib
* Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.tegge2006-09-261-0/+2
| | | | | This eliminates a race where MNT_UPDATE flag could be lost when nmount() raced against sync(), sync_fsync() or quotactl().
* Update comment.jhb2006-07-181-1/+1
|
* Add a kern_close() so that the ABIs can close a file descriptor w/o havingjhb2006-07-081-4/+2
| | | | to populate a close_args struct and change some of the places that do.
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-281-8/+2
| | | | Sponsored by: Isilon Systems, Inc.
* - Update vfs_root implementations to match the new prototype. None ofjeff2005-03-241-1/+2
| | | | | | | | these filesystems will support shared locks until they are explicitly modified to do so. Careful review must be done to ensure that this is safe for each individual filesystem. Sponsored by: Isilon Systems, Inc.
* Whitespace in vop_vector{} initializations.phk2005-01-131-0/+1
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-063-3/+3
|
* Convert to nmount. Add omount compat.phk2004-12-061-27/+37
| | | | Use vfs_mountedon(). Rely on vfs_mount.c calling VFS_STATFS().
* VFS_STATFS(mp, ...) is mostly called with &mp->mnt_stat, but a few casesphk2004-12-051-6/+0
| | | | | | | | doesn't. Most of the implementations have grown weeds for this so they copy some fields from mnt_stat if the passed argument isn't that. Fix this the cleaner way: Always call the implementation on mnt_stat and copy that in toto to the VFS_STATFS argument if different.
* Back when VOP_* was introduced, we did not have new-style structphk2004-12-013-19/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts)
* Mechanically change prototypes for vnode operations to use the new typedefs.phk2004-12-011-6/+6
|
* Refuse attempts to mount root filesystemphk2004-11-091-1/+1
|
* Put a version element in the VFS filesystem configuration structurephk2004-07-301-4/+3
| | | | | | | | | | | | | | | | | | and refuse initializing filesystems with a wrong version. This will aid maintenance activites on the 5-stable branch. s/vfs_mount/vfs_omount/ s/vfs_nmount/vfs_mount/ Name our filesystems mount function consistently. Eliminate the namiedata argument to both vfs_mount and vfs_omount. It was originally there to save stack space. A few places abused it to get hold of some credentials to pass around. Effectively it is unused. Reorganize the root filesystem selection code.
* Make LINT compilephk2004-07-131-1/+0
|
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-121-2/+3
| | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread.
* Remove spls from portal_open(). Acquire socket lock while sleepingrwatson2004-06-241-7/+8
| | | | | | waiting for the socket to connect and use msleep() on the socket mute rather than tsleep(). Acquire socket buffer mutexes around read-modify-write of socket buffer flags.
* Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead ofbde2004-06-231-10/+11
| | | | | | | | | depending on namespace pollution in <sys/vnode.h> for the definition of mutex interfaces used in SOCKBUF_*LOCK(). Sorted includes. Removed unused includes.
* Merge additional socket buffer locking from rwatson_netperf:rwatson2004-06-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | - Lock down low hanging fruit use of sb_flags with socket buffer lock. - Lock down low hanging fruit use of so_state with socket lock. - Lock down low hanging fruit use of so_options. - Lock down low-hanging fruit use of sb_lowwat and sb_hiwat with socket buffer lock. - Annotate situations in which we unlock the socket lock and then grab the receive socket buffer lock, which are currently actually the same lock. Depending on how we want to play our cards, we may want to coallesce these lock uses to reduce overhead. - Convert a if()->panic() into a KASSERT relating to so_state in soaccept(). - Remove a number of splnet()/splx() references. More complex merging of socket and socket buffer locking to follow.
* Remove advertising clause from University of California Regent'simp2004-04-073-12/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Export uipc_connect2() from uipc_usrreq.c instead of unp_connect2(),rwatson2004-03-311-1/+1
| | | | | | | | | | and consume that interface in portalfs and fifofs instead. In the new world order, unp_connect2() assumes that the unpcb mutex is held, whereas uipc_connect2() validates that the passed sockets are UNIX domain sockets, then grabs the mutex. NB: the portalfs and fifofs code gets down and dirty with UNIX domain sockets. Maybe this is a bad thing.
* Rename dup_sockaddr() to sodupsockaddr() for consistency with otherrwatson2004-03-011-1/+2
| | | | | | | | | | | | functions in kern_socket.c. Rename the "canwait" field to "mflags" and pass M_WAITOK and M_NOWAIT in from the caller context rather than "1" or "0". Correct mflags pass into mac_init_socket() from previous commit to not include M_ZERO. Submitted by: sam
* Initialize struct vfsops C99-sparsely.phk2003-06-121-21/+8
| | | | | Submitted by: hmp Reviewed by: phk
* Rename vfs_stdsync function to vfs_stdnosync which matches morekan2003-03-111-1/+1
| | | | | | | | | | | | | closely what function is really doing. Update all existing consumers to use the new name. Introduce a new vfs_stdsync function, which iterates over mount point's vnodes and call FSYNC on each one of them in turn. Make nwfs and smbfs use this new function instead of rolling their own identical sync implementations. Reviewed by: jeff
* Finish cleanup of vprint() which was begun with changing v_tag to a string.njl2003-03-031-1/+0
| | | | | | Remove extraneous uses of vop_null, instead defering to the default op. Rename vnode type "vfs" to the more descriptive "syncer". Fix formatting for various filesystems that use vop_print.
* Back out M_* changes, per decision of the TRB.imp2003-02-192-4/+4
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-212-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-132-3/+3
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-122-3/+3
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
* Repair vnode locking in portal_lookup(). Specifically, lock the filetjr2003-01-051-2/+10
| | | | | | vnode, and unlock the parent directory vnode if LOCKPARENT is not set. Obtained from: NetBSD (rev. 1.34)
* Fix a warning on 64 bits platforms: copyinstr() takesmux2002-10-061-1/+1
| | | | a size_t *, not an u_int *.
* Remove any VOP_PRINT that redundantly prints the tag.njl2002-09-181-18/+1
| | | | | | Move lockmgr_printinfo() into vprint() for everyone's benefit. Suggested by: bde
* Remove all use of vnode->v_tag, replacing with appropriate substitutes.njl2002-09-142-3/+3
| | | | | | | | | | | | 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)
* - Replace v_flag with v_iflag and v_vflagjeff2002-08-042-4/+4
| | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.tanimura2002-05-311-21/+12
| | | | Requested by: hsu
* Lock down a socket, milestone 1.tanimura2002-05-201-12/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
* Remove __P.alfred2002-03-192-16/+16
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-2/+2
| | | | reference.
* Replace ffind_* with fget calls.alfred2002-01-141-4/+1
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* remove unused socket pointeralfred2002-01-131-1/+0
|
* Include sys/_lock.h and sys/_mutex.h to reduce namespace pollution.alfred2002-01-131-0/+1
| | | | Requested by: jhb
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-132-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* o Make the credential used by socreate() an explicit argument torwatson2001-12-311-1/+2
| | | | | | | | | | | | | | socreate(), rather than getting it implicitly from the thread argument. o Make NFS cache the credential provided at mount-time, and use the cached credential (nfsmount->nm_cred) when making calls to socreate() on initially connecting, or reconnecting the socket. This fixes bugs involving NFS over TCP and ipfw uid/gid rules, as well as bugs involving NFS and mandatory access control implementations. Reviewed by: freebsd-arch
* convert holdsock() to fget(). Add XXX reminder for future socket locking.dillon2001-11-241-3/+6
|
* KSE Milestone 2julian2001-09-122-33/+33
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Fix warning: 568: warning: `portal_badop' defined but not usedpeter2001-06-151-13/+0
|
* Actually rename FDESC, PORTAL, UMAP and UNION file systems.ru2001-05-241-1/+1
| | | | OK'ed by: bp
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-232-2/+2
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* Change the second argument of vflush() to an integer that specifiesiedowse2001-05-161-12/+2
| | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp
OpenPOWER on IntegriCloud