summaryrefslogtreecommitdiffstats
path: root/sys/fs/udf/udf_vnops.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r308995:kib2016-11-291-2/+2
| | | | Do not dereference bp after bread(9) on error.
* Fix a -Wcast-qual warning in udf_vnops.c, by using __DECONST. Nodim2015-01-301-2/+3
| | | | | | functional change. MFC after: 3 days
* 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
* 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.
* 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
* 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-261-7/+20
| | | | | | | | | | | | | | | | | | | | | 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-261-3/+18
| | | | | 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)
* Mark udf(4) MPSAFE and add support for shared vnode locks during pathnamejhb2009-02-091-14/+30
| | | | | | | | | | | | | | 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.
* Add rudimentary support for symbolic links on UDF. Links are stored as ajhb2009-02-061-3/+112
| | | | | | | | 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-061-0/+61
| | | | | | | | | - 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)
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-6/+6
| | | | MFC after: 3 months
* 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
* VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used inattilio2008-01-131-1/+1
| | | | | | | | | | | 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>
* 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
|
* Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.pjd2007-02-151-0/+16
| | | | | | | | | | | | | | | | 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
* Call vnode_create_vobject() in VOP_OPEN. Makes mmap work on UDF filesystem.pav2006-12-231-0/+12
| | | | | | PR: kern/92040 Approved by: scottl MFC after: 1 week
* Make UDF endian-safe.will2006-02-031-1/+1
| | | | | Submitted by: Pedro Martelletto <pedro@ambientworks.net> (via scottl) Tested on: sparc64
* I ran into an nfs client panic a couple of times in a row over thealfred2006-01-171-1/+5
| | | | | | | | | | | | | | | | | | | | last few days. I tracked it down to the fact that nfs_reclaim() is setting vp->v_data to NULL _before_ calling vnode_destroy_object(). After silence from the mailing list I checked further and discovered that ufs_reclaim() is unique among FreeBSD filesystems for calling vnode_destroy_object() early, long before tossing v_data or much of anything else, for that matter. The rest, including NFS, appear to be identical, as if they were just clones of one original routine. The enclosed patch fixes all file systems in essentially the same way, by moving the call to vnode_destroy_object() to early in the routine (before the call to vfs_hash_remove(), if any). I have only tested NFS, but I've now run for over eighteen hours with the patch where I wouldn't get past four or five without it. Submitted by: Frank Mayhar Requested by: Mohan Srinivasan MFC After: 1 week
* 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.
* Regrab dvp only when ISDOTDOT.tanimura2005-07-091-1/+2
| | | | Approved by: re (scottl)
* Avoid casting from (int *) to (size_t *) in order to fix udf_iconv on amd64.imura2005-06-051-4/+5
| | | | | Reviewed by: scottl MFC after: 2 weeks
* Fix three typos in comments. Two of them obtained from OpenBSD.brueffer2005-05-111-3/+3
| | | | MFC after: 3 days
* - Change all filesystems and vfs_cache to relock the dvp once the child isjeff2005-04-131-3/+2
| | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc.
* - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.jeff2005-03-281-7/+5
| | | | | | | | - In the ISDOTDOT case we have to unlock the dvp before locking the child, if this fails we must relock dvp before returning an error. This was missing before. Sponsored by: Isilon Systems, Inc.
* Also remember to set the fsid here.phk2005-03-171-0/+1
|
* Don't hold a reference to the disk vnode for each inode.phk2005-03-151-6/+1
| | | | | Eliminate cdev and vnode pointer to the disk from the inodes, the mount holds everything we need.
* Use vfs_hash instead of home-rolled.phk2005-03-141-72/+2
| | | | Correct locking around g_vfs_close()
* Make filesystems get rid of their own vnodes vnode_pager object inphk2005-01-281-0/+1
| | | | VOP_RECLAIM().
* Fix an incorrect cast.scottl2005-01-181-1/+1
| | | | | Submitted by: Andriy Gapon MFC-after: 3 days.
* NULL-terminate the . and .. directory entries. Apparently some tools ignorescottl2005-01-141-0/+2
| | | | | | d_namlen and assume that d_name is null-terminated. Submitted by: Andriy Gapon
* Replace the min() macro with a test that doesn't truncate the 64-bit valuesscottl2005-01-141-1/+4
| | | | that are used. Thanks to Bruce Evans for pointing this out.
* Whitespace in vop_vector{} initializations.phk2005-01-131-0/+1
|
OpenPOWER on IntegriCloud