aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/ext2fs/ext2_extents.c
Commit message (Collapse)AuthorAgeFilesLines
* ext4_ext_tree_init: correct memset initializationRyan Libby2024-06-251-1/+1
| | | | | | | | | gcc -Wmemset-elt-size diagnosed this. The code was only initializing 1/4 of the array. However, it was actually harmless, as the only caller had done an M_ZERO allocation anyway. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45701
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* ext2fs: fix potential memory leak in ext4_ext_grow_indepth()Pedro F. Giffuni2022-12-171-2/+6
| | | | PR: 265071
* ext2: plug a set-but-not-used varMateusz Guzik2022-04-191-0/+4
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* Improve extents verification logicFedor Uporov2021-12-301-71/+220
| | | | | | | | | | | | | Add functionality for extents validation inside the filesystem extents block. The main logic is implemented under ext4_validate_extent_entries() function, which verifies extents or extents indexes depending of extent depth value. PR: 259112 Reported by: Robert Morris Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D33375
* ext2: plug set-but-not-used varsMateusz Guzik2021-11-241-8/+0
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* ext2fs: check for eh_depth in ext4_ext_check_header()Neel Chauhan2021-11-181-0/+4
| | | | | | | | PR: 259112 Reported by: Robert Morris <rtm@lcs.mit.edu> Reviewed by: fsu MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D33030
* Invalidate inode extents cache on truncation.Fedor Uporov2021-05-071-0/+1
| | | | | | | | | It is needed to invalidate cache in case of inode space removal to avoid situation, when extents cache returns not exist extent. Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29931
* Improve extents verification logic.Fedor Uporov2021-05-071-42/+88
| | | | | | | | | | It is possible to walk thru inode extents if EXT2FS_PRINT_EXTENTS macro is defined. The extents headers magics and physical blocks ranges are checked during extents walk. Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29932
* fs: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365070
* ext2fs: Stop checking for failures from malloc(M_WAITOK).Mark Johnston2020-07-201-11/+0
| | | | | | | | | | | PR: 240545 Submitted by: Andrew Reiter <arr@watson.org> Reviewed by: fsu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25707 Notes: svn path=/head/; revision=363367
* Add BE architectures support.Fedor Uporov2020-05-171-104/+116
| | | | | | | | | | | | Author of most initial version: pfg (https://reviews.freebsd.org/D23259) Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D24685 Notes: svn path=/head/; revision=361136
* ext2fs: Remove redundant brelse() after r294954Conrad Meyer2019-09-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coccinelle: @ rule1 @ identifier __error; @@ ... int __error; ... @ rule2 depends on rule1 @ identifier rule1.__error; identifier __bp; @@ __error = ( bread | bread_gb | breadn | breadn_flags ) (..., &__bp); if ( ( __error | __error != 0 ) ) { ... - brelse(__bp); ... } No functional change. Notes: svn path=/head/; revision=351926
* ext2fs: Initial version of DTrace support.Fedor Uporov2019-04-161-13/+23
| | | | | | | | | | | | Commit forgotten file. Reviewed by: pfg, gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19848 Notes: svn path=/head/; revision=346269
* Fix EXT2FS_DEBUG definition usage.Fedor Uporov2018-05-131-6/+6
| | | | | | | | | | Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D15394 Notes: svn path=/head/; revision=333584
* ext2fs: Cleanup variable assignments for extents.Pedro F. Giffuni2018-02-051-17/+13
| | | | | | | | | | | | | Delay the initialization of variables until the are needed. In the case of ext4_ext_rm_leaf(), make sure 'error' value is not undefined. Reported by: Clang's static analyzer Differential Revision: https://reviews.freebsd.org/D14193 Notes: svn path=/head/; revision=328882
* extfs: Remove unused variables.Pedro F. Giffuni2018-01-231-11/+0
| | | | | | | | | Found by: scan-build Reviewed by: fsu Differential Revision: https://reviews.freebsd.org/D14017 Notes: svn path=/head/; revision=328280
* Add metadata_csum feature support.Fedor Uporov2018-01-141-2/+8
| | | | | | | | | | | Reviewed by: pfg (mentor) Approved by: pfg (mentor) MFC after: 6 months Differential Revision: https://reviews.freebsd.org/D13810 Notes: svn path=/head/; revision=327977
* Add 64bit feature support.Fedor Uporov2018-01-051-1/+1
| | | | | | | | | | | Reviewed by: kevlo, pfg (mentor) Approved by: pfg (mentor) MFC after: 6 months Differential Revision: https://reviews.freebsd.org/D11530 Notes: svn path=/head/; revision=327584
* sys/fs: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326268
* Do not free bufs in case of extents metadata blocks + remove unneeded asserts.Fedor Uporov2017-10-241-6/+3
| | | | | | | | Approved by: pfg (mentor) MFC after: 6 months Notes: svn path=/head/; revision=324961
* Fix unused variable + style(9) fixes inside the ext4_ext_find_extent()Fedor Uporov2017-10-191-7/+4
| | | | | | | | | | Approved by: pfg (mentor) Reported by: Coverity CID: 1381754 MFC after: 6 months Notes: svn path=/head/; revision=324759
* Add inital extents read-write support.Fedor Uporov2017-10-171-118/+1486
| | | | | | | | | | | Approved by: pfg (mentor) MFC after: 6 months RelNotes: Yes Differential Revision: https://reviews.freebsd.org/D12087 Notes: svn path=/head/; revision=324706
* style(9) cleanups.Pedro F. Giffuni2016-12-281-5/+4
| | | | | | | | | Just to reduce some of the issues found with indent(1). MFC after: 1 week Notes: svn path=/head/; revision=310705
* Ext4: Use boolean type instead of '0' and '1'Pedro F. Giffuni2016-02-111-7/+7
| | | | | | | | | There are precedents of uses of bool in the kernel and it is incorrect style to use integers as replacement for a boolean type. Notes: svn path=/head/; revision=295523
* Ext4: fix handling of files with sparse blocks before extent's index.Pedro F. Giffuni2016-02-111-15/+40
| | | | | | | | | | | | | | | | | | | This is ongoing work from Damjan Jovanovic to improve ext4 read support with sparse files: Keep track of the first and last block in each extent as it descends down the extent tree, thus being able to work out that some blocks are sparse earlier. This solves an issue on r293680. In ext4_bmapext() start supporting the runb parameter, which appears to be the number of adjacent blocks prior to the block being converted in the same way that runp is the number of blocks after, speding up random access to mmaped files. PR: 206652 Notes: svn path=/head/; revision=295494
* ext4: add support for reading sparse filesPedro F. Giffuni2016-01-111-3/+23
| | | | | | | | | | | | | Add support for sparse files in ext4. Also implement read-ahead, which greatly increases the performance when transferring files from ext4. Both features implemented by Damjan Jovanovic. PR: 205816 MFC after: 1 week Notes: svn path=/head/; revision=293680
* ext2: Garbage-collect some unused variablesPedro F. Giffuni2015-01-191-2/+0
| | | | | | | | Reported by: clang static analysis MFC after: 2 weeks Notes: svn path=/head/; revision=277354
* Add read-only support for extents in ext2fs.Pedro F. Giffuni2013-08-121-0/+177
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 Notes: svn path=/head/; revision=254260