summaryrefslogtreecommitdiffstats
path: root/sys/fs/portalfs
Commit message (Collapse)AuthorAgeFilesLines
* Garbage collect PORTALFS bits which are now completely disconnected fromattilio2013-03-023-916/+0
| | | | | | the tree since few months. This patch is not targeted for MFC.
* Use NULL instead of 0 for pointerskevlo2012-07-221-4/+4
|
* Use NULL instead of 0kevlo2012-03-131-2/+2
|
* Make sure all intermediate variables holding mount flags (mnt_flag)mckusick2012-01-171-1/+1
| | | | | | | and that all internal kernel calls passing mount flags are declared as uint64_t so that flags in the top 32-bits are not lost. MFC after: 2 weeks
* Trace attempts to open a portal device.des2011-10-181-1/+6
| | | | Ceterum censeo portalfs esse delendam.
* Second-to-last commit implementing Capsicum capabilities in the FreeBSDrwatson2011-08-112-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc
* Mfp4 CH=177274,177280,177284-177285,177297,177324-177325bz2011-02-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | VNET socket push back: try to minimize the number of places where we have to switch vnets and narrow down the time we stay switched. Add assertions to the socket code to catch possibly unset vnets as seen in r204147. While this reduces the number of vnet recursion in some places like NFS, POSIX local sockets and some netgraph, .. recursions are impossible to fix. The current expectations are documented at the beginning of uipc_socket.c along with the other information there. Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Reviewed by: jhb Tested by: zec Tested by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 2 weeks
* Don't use ap->a_td->td_ucred when we were passed ap->a_cred.trasz2009-12-021-1/+1
|
* Rework the credential code to support larger values of NGROUPS andbrooks2009-06-192-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024 and 1023 respectively. (Previously they were equal, but under a close reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it is the number of supplemental groups, not total number of groups.) The bulk of the change consists of converting the struct ucred member cr_groups from a static array to a pointer. Do the equivalent in kinfo_proc. Introduce new interfaces crcopysafe() and crsetgroups() for duplicating a process credential before modifying it and for setting group lists respectively. Both interfaces take care for the details of allocating groups array. crsetgroups() takes care of truncating the group list to the current maximum (NGROUPS) if necessary. In the future, crsetgroups() may be responsible for insuring invariants such as sorting the supplemental groups to allow groupmember() to be implemented as a binary search. Because we can not change struct xucred without breaking application ABIs, we leave it alone and introduce a new XU_NGROUPS value which is always 16 and is to be used or NGRPS as appropriate for things such as NFS which need to use no more than 16 groups. When feasible, truncate the group list rather than generating an error. Minor changes: - Reduce the number of hand rolled versions of groupmember(). - Do not assign to both cr_gid and cr_groups[0]. - Modify ipfw to cache ucreds instead of part of their contents since they are immutable once referenced by more than one entity. Submitted by: Isilon Systems (initial implementation) X-MFC after: never PR: bin/113398 kern/133867
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-111-9/+8
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-232-9/+9
| | | | MFC after: 3 months
* The locking in portalfs's socket connect code is no less correct thanrwatson2008-10-121-1/+0
| | | | | | identical code in connect(2), so remove XXX that it might be incorrect. MFC after: 3 days
* Use soconnect2() rather than directly invoking uipc_connect2() torwatson2008-10-061-1/+1
| | | | | | interconnect two UNIX domain sockets. MFC after: 3 days
* fdescfs, devfs, mqueuefs, nfs, portalfs, pseudofs, tmpfs and xfskib2008-09-201-2/+1
| | | | | | | | | | | initialize the vattr structure in VOP_GETATTR() with VATTR_NULL(), vattr_null() or by zeroing it. Remove these to allow preinitialization of fields work in vn_stat(). This is needed to get birthtime initialized correctly. Submitted by: Jaakko Heinonen <jh saunalahti fi> Discussed on: freebsd-fs MFC after: 1 month
* Initialize va_rdev to NODEV instead of 0 or VNOVAL in VOP_GETATTR().kib2008-09-201-1/+1
| | | | | | | | | NODEV is more appropriate when va_rdev doesn't have a meaningful value. Submitted by: Jaakko Heinonen <jh saunalahti fi> Suggested by: bde Discussed on: freebsd-fs MFC after: 1 month
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadattilio2008-08-281-2/+0
| | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-102-3/+2
| | | | | | | | | | | | | | | | Remove this argument and pass curthread directly to underlying VOP_LOCK1() VFS method. This modify makes the code cleaner and in particular remove an annoying dependence helping next lockmgr() cleanup. KPI results, obviously, changed. Manpage and FreeBSD_version will be updated through further commits. As a side note, would be valuable to say that next commits will address a similar cleanup about VFS methods, in particular vop_lock1 and vop_unlock. Tested by: Diego Sardina <siarodx at gmail dot com>, Andrea Di Pasquale <whyx dot it at gmail dot com>
* Get rid of qaddr_t.alfred2007-10-161-1/+1
| | | | Requested by: bde
* 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 *.
OpenPOWER on IntegriCloud