summaryrefslogtreecommitdiffstats
path: root/sys/fs/ext2fs/ext2_vfsops.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r294504, r294652, r294653, r294655:pfg2016-03-171-2/+16
| | | | | | | | | | | | | | | | | | ext2fs: Bring back the htree dir_index implementation. The htree dir_index is perhaps one of the most characteristic features of the linux ext3 implementation. It was removed in r281670, due to repeated bug reports. Damjan Jovanic detected and fixed three bugs and did some stress testing by building Apache OpenOffice on top of it so it is now in good shape to bring back. Differential Revision: https://reviews.freebsd.org/D5007 Submitted by: Damjan Jovanovic Reviewed by: pfg RelNotes: yes
* MFC r293683:pfg2016-01-141-1/+1
| | | | | | | | | | | ext4: mount panic from freeing invalid pointers Initialize the struct with those fields to zeroes on allocation, preventing the panic. Patch by: Damjan Jovanovic. PR: 206056
* MFC: r281562rmacklem2015-04-301-1/+2
| | | | | | | | | | | File systems that do not use the buffer cache (such as ZFS) must use VOP_FSYNC() to perform the NFS server's Commit operation. This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which is set by file systems that use the buffer cache. If this flag is not set, the NFS server always does a VOP_FSYNC(). This should be ok for old file system modules that do not set MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although it might not be optimal for file systems that use the buffer cache.
* MFC r281670, r281703:pfg2015-04-221-16/+2
| | | | | | | | | | | | | | | | | | | | | | | Drop experimental ext2fs dir_index support. The htree directory index is a highly desirable feature for research purposes and was meant to improve performance in our ext2/3 driver. Unfortunately our implementation has two problems: - It never really delivered any performance improvement. - It appears to corrupt the filesystem in undetermined circumstances. Strictly speaking dir_index is not required for read/write support in ext2/3 and our limited ext4 support still works fine without it. Regain stability in the ext2 driver by removing it. We may need it back (fixed) if we want to support encrypted ext4 support but thanks to the wonders of version control we can always revert this change and bring it back. PR: 191895 PR: 198731 PR: 199309
* MFC r278790, r278802:pfg2015-02-221-5/+6
| | | | | | | | | Initialize the allocation of variables related to the ext2 allocator. Use malloc to clear the values and initialize e2fs_contigdirs during allocation. free() e2fs_contigdirs upon error. While here clean up small style issues.
* MFC r277354, r277365:pfg2015-02-021-2/+0
| | | | | | ext2: Garbage-collect some unused variables Reported by: clang static analysis
* MFC r274437;pfg2014-12-231-2/+2
| | | | | | | | ifdef ext2_print_inode which is not really used. ext2_print_inode was nice to have for initial development work but is not really used anymore. #ifdef it under a new EXT2FS_DEBUG knob so that we don't spend time compiling it.
* MFC r262623, r262667:pfg2014-03-041-4/+4
| | | | | | | | | | ext2fs: use of tab vs spaces. Consistently use a single tab after a #define as mentioned in style(9). Use tabs instead of space for indenting. Fix a typo: "hash_vesion". No functional change.
* MFC r262346:pfg2014-02-271-1/+2
| | | | | | | | | | | | | | | | | ext2fs: fully enable ext4 read-only support. The ext4 developers tend to tag Ext4-specific flags as "incompatible" even when such features are not relevant for read-only support. This is a consequence of the process though which this filesystem is implemented without design and the fact that some new features are not extensible to ext2/3. Organize the features according to what we support and sort them so that we can now read-only mount filesystems with some features that may be found in newly formatted ext4 fs. Submitted by: Zheng Liu
* MFC r260988, r261034, r261120, r261235:pfg2014-01-311-3/+3
| | | | | | | | | | | | | | | | ext2fs: Properly the EXT4_EXTENTS and EXT4_INDEX to the inode flags. In order to support Ext4 extents we need to pass the Ext4 inode flags without interfering with the chflags. This is better done by using the i_flag field in the inode and doing proper translation to the linux ext4 equivalents. Solve a potential corruption issue in the dirindex code. The dirindex code can now be renabled as the problems related to it have been solved. Suggested by: bde Tested by: kevlo
* Add read-only support for extents in ext2fs.pfg2013-08-121-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Basic support for extents was implemented by Zheng Liu as part of his Google Summer of Code in 2010. This support is read-only at this time. In addition to extents we also support the huge_file extension for read-only purposes. This works nicely with the additional support for birthtime/nanosec timestamps and dir_index that have been added lately. The implementation may not work for all ext4 filesystems as it doesn't support some features that are being enabled by default on recent linux like flex_bg. Nevertheless, the feature should be very useful for migration or simple access in filesystems that have been converted from ext2/3 or don't use incompatible features. Special thanks to Zheng Liu for his dedication and continued work to support ext2 in FreeBSD. Submitted by: Zheng Liu (lz@) Reviewed by: Mike Ma, Christoph Mallon (previous version) Sponsored by: Google Inc. MFC after: 3 weeks
* Initial implementation of the HTree directory index.pfg2013-07-061-0/+12
| | | | | | | | | | | | | | | | | | | This is a port of NetBSD's GSoC 2012 Ext3 HTree directory indexing by Vyacheslav Matyushin. It was cleaned up and enhanced for FreeBSD by Zheng Liu (lz@). This is an excellent example of work shared among different projects: Vyacheslav was able to look at an early prototype from Zheng Liu who was also able to check the code from Haiku (with permission). As in linux, the feature is not available by default and must be enabled explicitly with tune2fs. We still do not support the workarounds required in readdir for NFS. Submitted by: Zheng Liu Tested by: Mike Ma Sponsored by: Google Inc. MFC after: 1 week
* ext2fs: Use the complete random() range in i_gen.pfg2013-06-301-1/+1
| | | | | | | i_gen is unsigned in ext2fs so we can handle the complete 32 bits. MFC after: 1 week
* s/file system/filesystem/gpfg2013-06-111-2/+2
| | | | | | Based on r96755 from UFS. MFC after: 3 days
* ext2fs: Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE.pfg2013-02-081-1/+1
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: make e2fs_maxcontig local and remove tautological check.pfg2013-02-081-6/+3
| | | | | | | | | | | | | | | e2fs_maxcontig was modelled after UFS when bringing the "Orlov allocator" to ext2. On UFS fs_maxcontig is kept in the superblock and is used by userland tools (fsck and growfs), In ext2 this information is volatile so it is not available for userland tools, so in this case it doesn't have sense to carry it in the in-memory superblock. Also remove a pointless check for MAX(1, x) > 0. Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: general cleanup.pfg2013-02-021-8/+5
| | | | | | | | | | | | | | | | | | | | | | - Remove unused extern declarations in fs.h - Correct comments in ext2_dir.h - Several panic() messages showed wrong function names. - Remove commented out stray line in ext2_alloc.c. - Remove the unused macro EXT2_BLOCK_SIZE_BITS() and the then write-only member e2fs_blocksize_bits from struct m_ext2fs. - Remove the unused macro EXT2_FIRST_INO() and the then write-only member e2fs_first_inode from struct m_ext2fs. - Remove EXT2_DESC_PER_BLOCK() and the member e2fs_descpb from struct m_ext2fs. - Remove the unused members e2fs_bmask, e2fs_dbpg and e2fs_mount_opt from struct m_ext2fs - Correct harmless off-by-one error for fspath in ext2_vfsops.c. - Remove the unused and broken macros EXT2_ADDR_PER_BLOCK_BITS() and EXT2_DESC_PER_BLOCK_BITS(). - Remove the !_KERNEL versions of the EXT2_* macros. Submitted by: Christoph Mallon MFC after: 2 weeks
* More constant renaming in preparation for newer features.pfg2012-12-201-1/+1
| | | | | | | | | | | | | | | We also try to make better use of the fs flags instead of trying adapt the code according to the fs structures. In the case of subsecond timestamps and birthtime we now check that the feature is explicitly enabled: previously we only checked that the reserved space was available and silently wrote them. This approach is much safer, especially if the filesystem happens to use embedded inodes or support EAs. Discussed with: Zheng Liu MFC after: 5 days
* r16312 is not any longer real since many years (likely since when VFSattilio2012-11-191-8/+0
| | | | | | | | | | received granular locking) but the comment present in UFS has been copied all over other filesystems code incorrectly for several times. Removes comments that makes no sense now. Reviewed by: kib MFC after: 3 days
* 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
|
* Fix a typokevlo2012-07-031-1/+1
|
* Fix mount interlock oversights from the previous change in r234386.pluknet2012-05-101-2/+0
| | | | | | | Reported by: dougb Submitted by: Mateusz Guzik <mjguzik at gmail com> Reviewed by: Kirk McKusick Tested by: pho
* Replace the MNT_VNODE_FOREACH interface with MNT_VNODE_FOREACH_ALL.mckusick2012-04-171-20/+6
| | | | | | | | | | | | | | | | | | | | | The primary changes are that the user of the interface no longer needs to manage the mount-mutex locking and that the vnode that is returned has its mutex locked (thus avoiding the need to check to see if its is DOOMED or other possible end of life senarios). To minimize compatibility issues for third-party developers, the old MNT_VNODE_FOREACH interface will remain available so that this change can be MFC'ed to 9. Following the MFC to 9, MNT_VNODE_FOREACH will be removed in head. The reason for this update is to prepare for the addition of the MNT_VNODE_FOREACH_ACTIVE interface that will loop over just the active vnodes associated with a mount point (typically less than 1% of the vnodes associated with the mount point). Reviewed by: kib Tested by: Peter Holm MFC after: 2 weeks
* Add support for ns timestamps and birthtime to the ext2/3 driver.pfg2012-03-081-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using big inodes there is sufficient space in ext3 to keep extra resolution and birthtime (creation) timestamps. The appropriate fields in the on-disk inode have been approved for a long time but support for this in ext3 has not been widely distributed. In preparation for ext4 most linux distributions have enabled by default such bigger inodes and some people use nanosecond timestamps in ext3. We now support those when the inode is big enough and while we do recognize the EXT4F_ROCOMPAT_EXTRA_ISIZE, we maintain the extra timestamps even when they are not used. An additional note by Bruce Evans: We blindly accept unrepresentable tv_nsec in VOP_SETATTR(), but all file systems have always done that. When POSIX gets around to specifying the behaviour, it will probably require certain rounding to the fs's resolution and not rejecting the request. This unfortunately means that syscalls that set times can't really tell if they succeeded without reading back the times using stat() or similar and checking that they were set close enough. Reviewed by: bde Approved by: jhb (mentor) MFC after: 2 weeks
* Style cleanups by jh@.pfg2011-12-161-6/+5
| | | | | | | | | | Fix a comment from the previous commit. Use M_ZERO instead of bzero() in ext2_vfsops.c Add include guards from PR. PR: 162564 Approved by: jhb (mentor) MFC after: 2 weeks
* Bring in reallocblk to ext2fs.pfg2011-12-151-3/+54
| | | | | | | | | | | | | | | | | The feature has been standard for a while in UFS as a means to reduce fragmentation, therefore maintaining consistent performance with filesystem aging. This is also very similar to what ext4 calls "delayed allocation". In his 2010 GSoC, Zheng Liu ported and benchmarked the missing FANCY_REALLOC code to find more consistent performance improvements than with the preallocation approach. PR: 159233 Author: Zheng Liu <gnehzuil AT SPAMFREE gmail DOT com> Sponsored by: Google Inc. Approved by: jhb (mentor) MFC after: 2 weeks
* 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
* Use a private EXT2_ROOTINO constant instead of redefining ROOTINO.jhb2011-04-271-2/+2
| | | | Submitted by: Pedro F. Giffuni giffunip at yahoo
* Some cosmetic fixes and remove a duplicate constant.jhb2011-02-011-2/+3
| | | | Submitted by: Pedro F. Giffuni giffunip at yahoo
* Restore support for the 'async' and 'sync' mount options lost whenjhb2011-01-211-3/+3
| | | | | | | | switching to nmount(2). While here, sort the options. PR: kern/153584 Submitted by: Pedro F. Giffuni giffunip at yahoo MFC after: 1 week
* Merge 118969 from UFS:jhb2011-01-191-2/+1
| | | | | | | | Eliminate the i_devvp field from the incore inodes, we can get the same value from ip->i_ump->um_devvp. Submitted by: Pedro F. Giffuni giffunip at yahoo MFC after: 1 week
* Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summerlulf2010-01-141-0/+1071
of Code 2009: - BSDL block and inode allocation policies for ext2fs. This involves the use FFS1 style block and inode allocation for ext2fs. Preallocation was removed since it was GPL'd. - Make ext2fs MPSAFE by introducing locks to per-mount datastructures. - Fixes for kern/122047 PR. - Various small bugfixes. - Move out of gnu/ directory. Sponsored by: Google Inc. Submitted by: Aditya Sarawgi <sarawgi.aditya AT SPAMFREE gmail DOT com>
OpenPOWER on IntegriCloud