summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/msdosfs_vfsops.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert previous, part of NFS that I didn't know about.trhodes2007-06-011-0/+20
|
* Garbage collect msdosfs_fhtovp; it appears unused and I have been usingtrhodes2007-06-011-20/+0
| | | | MSDOSFS without this function and problems for the last month.
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-151-17/+0
| | | | | | | | | | | | | | | | This way we may support multiple structures in v_data vnode field within one file system without using black magic. Vnode-to-file-handle should be VOP in the first place, but was made VFS operation to keep interface as compatible as possible with SUN's VFS. BTW. Now Solaris also implements vnode-to-file-handle as VOP operation. VFS_VPTOFH() was left for API backward compatibility, but is marked for removal before 8.0-RELEASE. Approved by: mckusick Discussed with: many (on IRC) Tested with: ufs, msdosfs, cd9660, nullfs and zfs
* Add noatime to the list of mount options that msdosfs accepts.rodrigc2007-02-081-1/+1
| | | | | PR: 108896 Submitted by: Eugene Grosbein <eugen grosbein pp ru>
* Style fixes: use ANSI C function declarations.rodrigc2007-02-081-31/+8
|
* Eliminate some dead code which was introduced in 1.23, yet was alwaysrodrigc2007-02-061-11/+0
| | | | commented out.
* Fixing compilation bustage by removing references to opt_msdosfs.h.avatar2007-01-301-2/+0
| | | | | This auto-generated header file no longer exists since the removal of MSDOSFS_LARGE in sys/conf/options:1.574.
* Add a "-o large" mount option for msdosfs. Convert compile-time checks forrodrigc2007-01-301-19/+34
| | | | | | | | | | | | | | | | #ifdef MSDOSFS_LARGE to run-time checks to see if "-o large" was specified. Test case provided by Oliver Fromme: truncate -s 200G test.img mdconfig -a -t vnode -f test.img -u 9 newfs_msdos -s 419430400 -n 1 /dev/md9 zip250 mount -t msdosfs /dev/md9 /mnt # should fail mount -t msdosfs -o large /dev/md9 /mnt # should succeed PR: 105964 Requested by: Oliver Fromme <olli lurza secnetix de> Tested by: trhodes MFC after: 2 weeks
* When performing a mount update to change a mount from read-only to read-write,rodrigc2007-01-061-4/+10
| | | | | | | | | | | | | | | | | | | | | do not call markvoldirty() until the mount has been flagged as read-write. Due to the nature of the msdosfs code, this bug only seemed to appear for FAT-16 and FAT-32. This fixes the testcase: #!/bin/sh dd if=/dev/zero bs=1m count=1 oseek=119 of=image.msdos mdconfig -a -t vnode -f image.msdos newfs_msdos -F 16 /dev/md0 fd120m mount_msdosfs -o ro /dev/md0 /mnt mount | grep md0 mount -u -o rw /dev/md0; echo $? mount | grep md0 umount /mnt mdconfig -d -u 0 PR: 105412 Tested by: Eugene Grosbein <eugen grosbein pp ru>
* Minor cleanup. If we are doing a mount update, and we pass inrodrigc2006-12-091-4/+8
| | | | | | | | | | | an "export" flag indicating that we are trying to NFS export the filesystem, and the MSDOSFS_LARGEFS flag is set on the filesystem, then deny the mount update and export request. Otherwise, let the full mount update proceed normally. MSDOSFS_LARGES and NFS don't mix because of the way inodes are calculated for MSDOSFS_LARGEFS. MFC after: 3 days
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-18/+19
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Use mount interlock to protect all changes to mnt_flag and mnt_kern_flag.tegge2006-09-261-0/+4
| | | | | This eliminates a race where MNT_UPDATE flag could be lost when nmount() raced against sync(), sync_fsync() or quotactl().
* When the volume is being downgraded from a read-write mode, markdelphij2006-08-031-0/+4
| | | | | | | | it as clean. PR: kern/85366 Submitted by: Dan Lukes <dan at obluda dot cz> MFC After: 2 weeks
* mount_msdosfs.c:rodrigc2006-06-011-1/+1
| | | | | | | | | | | | | | - remove call to getmntopts(), and just pass -o options to nmount(). This removes some confusion as to what options msdosfs can parse, by pushing the responsibility of option parsing to the VFS and FS specific code in the kernel. msdosfs_vfsops.c: - add "force" and "sync" to msdosfs_opts. They used to be specified in mount_msdosfs.c, so move them here. It's not clear whethere these options should be placed into global_opts in vfs_mount.c or not. Motivated by: marcus
* Remove calls to vfs_export() for exporting a filesystem for NFS mountingrodrigc2006-05-261-10/+5
| | | | | from individual filesystems. Call it instead in vfs_mount.c, after we call VFS_MOUNT() for a specific filesystem.
* Properly parse the nowin95 mount option.rodrigc2005-11-191-5/+4
| | | | Tested by: Rainer Hurling <rhurlin at gwdg dot de>
* Add "shortnames" and "longnames" mount options which arerodrigc2005-11-181-1/+5
| | | | | | | | | | synonyms for "shortname" and "longname" mount options. The old (before nmount()) mount_msdosfs program accepted "shortnames" and "longnames", but the kernel nmount() checked for "shortname" and "longname". So, make the kernel accept "shortnames", "longnames", "shortname", "longname" for forwards and backwarsd compatibility. Discovered by: Rainer Hurling <rhurlin at gwdg dot de>
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-2/+2
| | | | | | | | | | | | | | | | | | | - 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.
* Remove checks for BOOTSIG[23] from FAT32 bootblocks.peadar2005-09-291-3/+1
| | | | | | | | | There seems to be very little documentary evidence outside this implementation to suggest a these checks are neccessary, and more than one camera-formatted flash disk fails the check, but mounts successfully on most other systems. Reviewed By: bde@
* *_mountfs() (if the filesystem mounts from a device) needs devvp to bessouhlal2005-09-021-5/+3
| | | | | | | locked, so lock it. Glanced at by: phk MFC after: 3 days
* - Update vfs_root implementations to match the new prototype. None ofjeff2005-03-241-2/+4
| | | | | | | | 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.
* Eliminate cdev pointer in inodes, they're not used or needed.phk2005-03-151-1/+0
| | | | | The cdev could have been pulled out of the mountpoint cheaper back when it was used anyway.
* Use vfs_hash instead of home-rolling.phk2005-03-141-2/+0
|
* - The VI_DOOMED flag now signals the end of a vnode's relationship withjeff2005-03-131-1/+1
| | | | | | | | the filesystem. Check that rather than VI_XLOCK. - VOP_INACTIVE should no longer drop the vnode lock. - The vnode lock is required around calls to vrecycle() and vgone(). Sponsored by: Isilon Systems, Inc.
* Use vn_printf() instead of home-rolling.phk2005-02-221-10/+2
|
* Introduce and use g_vfs_close().phk2005-01-251-2/+2
|
* Create a vp->v_object in VFS_FHTOVP() if we want to be exportablephk2005-01-241-0/+1
| | | | | | | | | | | | | with NFS. We are moving responsibility for creating the vnode_pager object into the filesystems which own the vnode, and this is one of the places we have to cover. We call vnode_create_vobject() directly because we own the vnode. If we can get the size easily, pass it as an argument to save the call to VOP_GETATTR() in vnode_create_vobject()
* Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().phk2005-01-111-5/+4
| | | | | | | | | | | | | | | | | | I'm not sure why a credential was added to these in the first place, it is not used anywhere and it doesn't make much sense: The credentials for syncing a file (ability to write to the file) should be checked at the system call level. Credentials for syncing one or more filesystems ("none") should be checked at the system call level as well. If the filesystem implementation needs a particular credential to carry out the syncing it would logically have to the cached mount credential, or a credential cached along with any delayed write data. Discussed with: rwatson
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Handle MNT_UPDATE export requests first and return so we do notphk2004-12-111-14/+14
| | | | | | interpret the rest of the msdosfs_args structure. Detected by: marcel
* Convert msdosfs to nmount.phk2004-12-061-75/+121
| | | | | | | | | | | | | Add a vfs_cmount() function which converts omount argument stucture to nmount arguments. Convert vfs_omount() to vfs_mount() and parse nmount arguments. This is 100% compatible with existing userland. Later on, but before userland gets converted to nmount we may want to revisit the names of the mountoptions, for instance it may make sense to use consistent options for charset conversion etc.
* 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.
* Refuse attemps to mount root filesystemphk2004-11-091-0/+2
|
* Move MSDOSFS to GEOM backing instead of DEVFS.phk2004-10-291-47/+42
| | | | For details, please see src/sys/ufs/ffs/ffs_vfsops.c 1.250.
* Reduce the locking activity by epsilon by checking VNON condition beforephk2004-10-281-4/+3
| | | | releasing the mountlock.
* Loose the v_dirty* and v_clean* alias macros.phk2004-10-251-4/+5
| | | | | Check the count field where we just want to know the full/empty state, rather than using TAILQ_EMPTY() or TAILQ_FIRST().
* Remove bogus vrele() call added in previous.tjr2004-08-271-2/+0
|
* Improve the robustness of MSDOSFSMNT_KICONV handling:tjr2004-08-261-12/+39
| | | | | | | | | - Use copyinstr() to read cs_win, cs_dos, cs_local strings from the mount argument structure instead of reading through user-space pointers(!). - When mounting a filesystem, or updating an existing mount, only try to update the iconv handles from the information in the mount argument structure if the structure itself has the MSDOSFSMNT_KICONV flag set. - Attempt to handle failure of update_mp() in the MNT_UPDATE case.
* Push all changes to disk before downgrading a mount from rw to ro.phk2004-08-071-0/+3
|
* Put a version element in the VFS filesystem configuration structurephk2004-07-301-9/+9
| | | | | | | | | | | | | | | | | | 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.
* Remove global variable rootdevs and rootvp, they are unused as such.phk2004-07-281-1/+1
| | | | | | | | Add local rootvp variables as needed. Remove checks for miniroot's in the swappartition. We never did that and most of the filesystems could never be used for that, but it had still been copy&pasted all over the place.
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-121-7/+10
| | | | | | 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.
* When we traverse the vnodes on a mountpoint we need to look out forphk2004-07-041-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | our cached 'next vnode' being removed from this mountpoint. If we find that it was recycled, we restart our traversal from the start of the list. Code to do that is in all local disk filesystems (and a few other places) and looks roughly like this: MNT_ILOCK(mp); loop: for (vp = TAILQ_FIRST(&mp...); (vp = nvp) != NULL; nvp = TAILQ_NEXT(vp,...)) { if (vp->v_mount != mp) goto loop; MNT_IUNLOCK(mp); ... MNT_ILOCK(mp); } MNT_IUNLOCK(mp); The code which takes vnodes off a mountpoint looks like this: MNT_ILOCK(vp->v_mount); ... TAILQ_REMOVE(&vp->v_mount->mnt_nvnodelist, vp, v_nmntvnodes); ... MNT_IUNLOCK(vp->v_mount); ... vp->v_mount = something; (Take a moment and try to spot the locking error before you read on.) On a SMP system, one CPU could have removed nvp from our mountlist but not yet gotten to assign a new value to vp->v_mount while another CPU simultaneously get to the top of the traversal loop where it finds that (vp->v_mount != mp) is not true despite the fact that the vnode has indeed been removed from our mountpoint. Fix: Introduce the macro MNT_VNODE_FOREACH() to traverse the list of vnodes on a mountpoint while taking into account that vnodes may be removed from the list as we go. This saves approx 65 lines of duplicated code. Split the insmntque() which potentially moves a vnode from one mount point to another into delmntque() and insmntque() which does just what the names say. Fix delmntque() to set vp->v_mount to NULL while holding the mountpoint lock.
* By popular request, add a workaround that allows large (>128GB or so)tjr2004-07-031-0/+14
| | | | | | | | | | | | | | | FAT32 filesystems to be mounted, subject to some fairly serious limitations. This works by extending the internal pseudo-inode-numbers generated from the file's starting cluster number to 64-bits, then creating a table mapping these into arbitrary 32-bit inode numbers, which can fit in struct dirent's d_fileno and struct vattr's va_fileid fields. The mappings do not persist across unmounts or reboots, so it's not possible to export these filesystems through NFS. The mapping table may grow to be rather large, and may grow large enough to exhaust kernel memory on filesystems with millions of files. Don't enable this option unless you understand the consequences.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Don't reject FAT file systems with a number of "Heads" greater thanrwatson2004-03-141-1/+1
| | | | | | 255; USB keychains exist that use 256 as the number of heads. This check has also been removed in Darwin (along with most of the other head/sector sanity checks).
* Fixed a serious off by 1 error. The cluster-in-use bitmap was overrunbde2004-02-211-2/+1
| | | | | | | by 1 u_int if the number of clusters was 1 more than a multiple of (8 * sizeof(u_int)). The bitmap is malloced and large (often huge), so fatal overrun probably only occurred if the number of clusters was 1 more than 1 multiple of PAGE_SIZE/8.
* If the "next free cluster" field of the FSInfo block is 0xFFFFFFFF,tjr2004-02-171-2/+4
| | | | | | | | | | it means that the correct value is unknown. Since this value is just a hint to improve performance, initially assume that the first non-reserved cluster is free, then correct this assumption if necessary before writing the FSInfo block back to disk. PR: 62826 MFC after: 2 weeks
* Fixed some style bugs:bde2004-02-141-4/+4
| | | | | | - don't unlock the vnode after vinvalbuf() only to have to relock it almost immediately. - don't refer to devices classified by vn_isdisk() as block devices.
* MFffs (ffs_vfsops.c 1.227: clean up open mode bandaid). This reducesbde2004-02-121-11/+12
| | | | gratuitous differences with ffs a little.
OpenPOWER on IntegriCloud