summaryrefslogtreecommitdiffstats
path: root/sys/fs/udf
Commit message (Collapse)AuthorAgeFilesLines
* MFC r277952:dim2015-02-031-2/+3
| | | | | Fix a -Wcast-qual warning in udf_vnops.c, by using __DECONST. No functional change.
* Add currently unused flag argument to the cluster_read(),kib2013-03-141-2/+3
| | | | | | | | cluster_write() and cluster_wbuild() functions. The flags to be allowed are a subset of the GB_* flags for getblk(). Sponsored by: The FreeBSD Foundation Tested by: pho
* Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag.attilio2012-11-091-2/+1
| | | | | Porters should refer to __FreeBSD_version 1000021 for this change as it may have happened at the same timeframe.
* Use NULL instead of 0 for pointerskevlo2012-07-221-1/+1
|
* Remove fifo.h. The only used function declaration from the header iskib2012-03-111-1/+0
| | | | | | migrated to sys/vnode.h. Submitted by: gianni
* Fix found places where uio_resid is truncated to int.kib2012-02-211-1/+2
| | | | | | | | | Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from the usermode. Discussed with: bde, das (previous versions) MFC after: 1 month
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-2/+2
| | | | This means that their use is restricted to a single C file.
* Add a lock flags argument to the VFS_FHTOVP() file systemrmacklem2011-05-221-1/+1
| | | | | | | | | | | 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
* Revert the previous commit. The race is not applicable to the lockmgrjhb2010-07-161-4/+1
| | | | | | | | implementation in 8.0 and later as its flags field does not hold dynamic state such as waiters flags, but is only modified in lockinit() aside from VN_LOCK_*(). Discussed with: attilio
* When the MNTK_EXTENDED_SHARED mount option was added, some filesystems werejhb2010-07-161-1/+4
| | | | | | | | | | | | | | changed to defer the setting of VN_LOCK_ASHARE() (which clears LK_NOSHARE in the vnode lock's flags) until after they had determined if the vnode was a FIFO. This occurs after the vnode has been inserted a VFS hash or some similar table, so it is possible for another thread to find this vnode via vget() on an i-node number and block on the vnode lock. If the lockmgr interlock (vnode interlock for vnode locks) is not held when clearing the LK_NOSHARE flag, then the lk_flags field can be clobbered. As a result the thread blocked on the vnode lock may never get woken up. Fix this by holding the vnode interlock while modifying the lock flags in this case. MFC after: 3 days
* udf_vnops: cosmetic followup to r208671 - better looking codeavg2010-06-221-1/+1
| | | | | Suggested by: jhb MFC after: 3 days
* udf_readlink: fix malloc call with uninitialized size parameteravg2010-05-311-1/+1
| | | | | Found by: clang static analyzer MFC after: 4 days
* Use #ifdef APPLE_MAC instead of #ifdef MAC to conditionalize Apple-specificrwatson2009-06-061-2/+2
| | | | | | | | | | behavior for unicode support in UDF so as not to conflict with the MAC Framework. Note that Apple's XNU kernel also uses #ifdef MAC for the MAC Framework. Suggested by: pjd MFC after: 3 days
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-111-5/+7
| | | | | | | | | | | | | | | | | 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.
* Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that ajhb2009-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | filesystem supports additional operations using shared vnode locks. Currently this is used to enable shared locks for open() and close() of read-only file descriptors. - When an ISOPEN namei() request is performed with LOCKSHARED, use a shared vnode lock for the leaf vnode only if the mount point has the extended shared flag set. - Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but not O_CREAT. - Use a shared vnode lock around VOP_CLOSE() if the file was opened with O_RDONLY and the mountpoint has the extended shared flag set. - Adjust md(4) to upgrade the vnode lock on the vnode it gets back from vn_open() since it now may only have a shared vnode lock. - Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since FIFO's require exclusive vnode locks for their open() and close() routines. (My recent MPSAFE patches for UDF and cd9660 already included this change.) - Enable extended shared operations on UFS, cd9660, and UDF. Submitted by: ups Reviewed by: pjd (ZFS bits) MFC after: 1 month
* udf: use truly unique directory cookieavg2009-03-041-1/+1
| | | | | | | | 'off' is an offset within current block, so there is a good chance it can be non-unique, so use complete offset. Submitted by: bde Approved by: jhb
* udf_strategy: remove redundant commentavg2009-03-041-4/+0
| | | | | | | | | We fail mapping for any udf_bmap_internal error and there can be different reasons for it, so no need to (over-)emphasize files with data in fentry. Submitted by: bde Approved by: jhb
* udf_readdir: do not advance offset if entry can not be uio-edavg2009-03-031-1/+1
| | | | | | | | | | Previosly readdir missed some directory entries because there was no space for them in current uio but directory stream offset was advanced nevertheless. jhb has discoved the issue and provided a test-case. Reviewed by: bde Approved by: jhb (mentor)
* udf_readatoffset: return correct size and data pointer for data in fentryavg2009-02-271-0/+6
| | | | | | | | This should help correct reading of directories with data located in fentry. Submitted by: bde Approved by: jhb (mentor)
* udf_readatoffset: read through directory vnode, do not read > MAXBSIZEavg2009-02-263-25/+23
| | | | | | | | | | | | | | | | | | | | | Currently bread()-ing through device vnode with (1) VMIO enabled, (2) bo_bsize != DEV_BSIZE (3) more than 1 block results in data being incorrectly cached. So instead a more common approach of using a vnode belonging to fs is now employed. Also, prevent attempt to bread more than MAXBSIZE bytes because of adjustments made to account for offset that doesn't start on block boundary. Add expanded comments to explain the calculations. Also drop unused inline function while here. PR: kern/120967 PR: kern/129084 Reviewed by: scottl, kib Approved by: jhb (mentor)
* udf: add read-ahead support modeled after cd9660avg2009-02-262-3/+23
| | | | | Reviewed by: scottl Approved by: jhb (mentor)
* udf_map: return proper error code instead of leaking an internal oneavg2009-02-261-2/+13
| | | | | | | Incidentally this also allows for small files with data embedded into fentry to be mmap-ed. Approved by: jhb (mentor)
* udf_read: correctly read data from files with data embedded into fentry,avg2009-02-261-0/+26
| | | | | | | | ... as opposed to files with data in extents. Some UDF authoring tools produce this type of file for sufficiently small data files. Approved by: jhb (mentor)
* udf_strategy: tiny optimization of logic, calculations; extra diagnosticsavg2009-02-261-14/+11
| | | | | | | | | | | Use bit-shift instead of division/multiplication. Act on error as soon as it is detected. Report attempt to read data embedded in file entry via regular way. While there, fix lblktosize macro and make use of it. No functionality should change as a result. Approved by: jhb (mentor)
* style nit in r188815avg2009-02-191-1/+1
| | | | | Pointed out by: jhb, rpaulo Approved by: jhb (mentor)
* fs/udf: fix incorrect error return (-1) when reading a large diravg2009-02-191-4/+3
| | | | | | | | | | | | Not enough space in user-land buffer is not an error, userland will read further until eof is reached. So instead of propagating -1 to caller we convert it to zero/success. cd9660 code works exactly the same way. PR: kern/78987 Reviewed by: jhb (mentor) Approved by: jhb (mentor)
* - Consolidate error handling in the cd9660 and udf mount routines.jhb2009-02-111-14/+18
| | | | | | | | | - Always read the character device pointer while the associated devfs vnode is locked. Also, use dev_ref() to obtain a new reference on the vnode for the mountpoint. This reference is released on unmount. This mirrors the earlier fix to FFS. Reviewed by: kib
* Mark udf(4) MPSAFE and add support for shared vnode locks during pathnamejhb2009-02-092-24/+55
| | | | | | | | | | | | | | lookups: - Honor the caller's locking flags in udf_root() and udf_vget(). - Set VV_ROOT for the root vnode in udf_vget() instead of only doing it in udf_root(). - Honor the requested locking flags during pathname lookups in udf_lookup(). - Release the buffer holding the directory data before looking up the vnode for a given file to avoid a LOR between the "udf" vnode locks and "bufwait". - Use vn_vget_ino() to handle ".." lookups. - Special case "." lookups instead of calling udf_vget(). We have to do extra checking for the vnode lock for "." lookups.
* Use the same style as the rest of the file for the optional data stringjhb2009-02-091-1/+1
| | | | after each path component rather than a GCC-ism.
* Add rudimentary support for symbolic links on UDF. Links are stored as ajhb2009-02-062-3/+124
| | | | | | | | sequence of pathname components. We walk the list building a string in the caller's passed in buffer. Currently this only handles path names in CS8 (character set 8) as that is what mkisofs generates for UDF images. MFC after: 1 month
* Add support for fifos to UDF:jhb2009-02-063-0/+64
| | | | | | | | | - Add a separate set of vnode operations that inherits from the fifo ops and use it for fifo nodes. - Add a VOP_SETATTR() method that allows setting the size (by silently ignoring the requests) of fifos. This is to allow O_TRUNC opens of fifo devices (e.g. I/O redirection in shells using ">"). - Add a VOP_PRINT() handler while I'm here.
* Remove unused local variables.bz2009-01-311-2/+0
| | | | | | Submitted by: Christoph Mallon christoph.mallon@gmx.de Reviewed by: kib MFC after: 2 weeks
* Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessarytrasz2008-10-281-4/+5
| | | | | | | to add more V* constants, and the variables changed by this patch were often being assigned to mode_t variables, which is 16 bit. Approved by: rwatson (mentor)
* Fix a number of style issues in the MALLOC / FREE commit. I've tried todes2008-10-231-3/+3
| | | | | be careful not to fix anything that was already broken; the NFSv4 code is particularly bad in this respect.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-232-15/+14
| | | | MFC after: 3 months
* Remove the struct thread unuseful argument from bufobj interface.attilio2008-10-101-6/+6
| | | | | | | | | | | | | | | | | | | | | In particular following functions KPI results modified: - bufobj_invalbuf() - bufsync() and BO_SYNC() "virtual method" of the buffer objects set. Main consumers of bufobj functions are affected by this change too and, in particular, functions which changed their KPI are: - vinvalbuf() - g_vfs_close() Due to the KPI breakage, __FreeBSD_version will be bumped in a later commit. As a side note, please consider just temporary the 'curthread' argument passing to VOP_SYNC() (in bufsync()) as it will be axed out ASAP Reviewed by: kib Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* 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
* Fix and speedup timestamp calculations which is roughly based on the patch inmarkus2008-05-161-22/+34
| | | | | | | | | | | | | | | | | | | | the mentioned PR: - bounds check time->month as it is used as an array index - fix usage of time->month as array index (month is 1-12) - fix calculation based on time->day (day is 1-31) - fix the speedup code as it doesn't calculate correct timestamps before the year 2000 and reduce the number of calculation in the year-by-year code - speedup month calculations by replacing the array content with cumulative values - add microseconds calculation - fix an endian problem PR: kern/97786 Submitted by: Andriy Gapon <avg@topspin.kiev.ua> Reviewed by: scottl (earlier version) Approved by: emax (mentor) MFC after: 1 week
* Cleanup lockmgr interface and exported KPI:attilio2008-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | - Remove the "thread" argument from the lockmgr() function as it is always curthread now - Axe lockcount() function as it is no longer used - Axe LOCKMGR_ASSERT() as it is bogus really and no currently used. Hopefully this will be soonly replaced by something suitable for it. - Remove the prototype for dumplockinfo() as the function is no longer present Addictionally: - Introduce a KASSERT() in lockstatus() in order to let it accept only curthread or NULL as they should only be passed - Do a little bit of style(9) cleanup on lockmgr.h KPI results heavilly broken by this change, so manpages and FreeBSD_version will be modified accordingly by further commits. Tested by: matteo
* udf_vget() shall vgone() the vnode when the file_entry cannot be allocatedkib2008-01-181-0/+3
| | | | | | | | or read from the volume. Otherwise, half-constructed vnode could be found later and cause panic when accessed. PR: 118322 MFC after: 1 week
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-132-2/+2
| | | | | | | | | | | conjuction with 'thread' argument passing which is always curthread. Remove the unuseful extra-argument and pass explicitly curthread to lower layer functions, when necessary. KPI results broken by this change, which should affect several ports, so version bumping and manpage update will be further committed. Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>
* vn_lock() is currently only used with the 'curthread' passed as argument.attilio2008-01-101-1/+1
| | | | | | | | | | | | | | | | 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>
* Fix calculation of descriptor tag checksums. According to ECMA-167, Part 4,markus2007-12-111-1/+1
| | | | | | | | | | 7.2.3, bytes 0-3 and 5-15 are used to calculate the checksum of a descriptor tag. PR: kern/90521 Submitted by: Björn König <bkoenig@cs.tu-berlin.de> Reviewed by: scottl Approved by: emax (mentor)
* Get rid of qaddr_t.alfred2007-10-161-2/+2
| | | | Requested by: bde
* Correct corrupt read when the read starts at a non-aligned offset.remko2007-06-111-4/+6
| | | | | | | | PR: kern/77234 MFC After: 1 week Approved by: imp (mentor) Requested by: many many people Submitted by: Andriy Gapon <avg at icyb dot net dot ua>
* o cd9660 code repo-copied, update a comment.maxim2007-03-241-1/+1
|
* Make insmntque() externally visibile and allow it to fail (e.g. duringtegge2007-03-131-1/+7
| | | | | | | | | | | | | | | | | | | | | | | 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
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-153-23/+23
| | | | | | | | | | | | | | | | 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
* Rewrite the udf_read() routine to use a file vnode instead of the devvp vnode.pav2007-01-151-24/+52
| | | | | | | | | | | | The code is modelled after cd9660, including support for simple read-ahead courtesy of clustered read. Fix udf_strategy to DTRT. This change fixes sendfile(2) not to send out garbage. Reviewed by: scottl MFC after: 1 month
* Tell backing v_object the filesize right on it's creation.pav2007-01-071-1/+6
| | | | MFC after: 1 week
OpenPOWER on IntegriCloud