aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/ext2fs/ext2_inode.c
Commit message (Collapse)AuthorAgeFilesLines
* sys: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Fix build with gcc12.Navdeep Parhar2023-10-271-0/+6
|
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Move mnt_maxsymlinklen into appropriate fs mount data structuresKonstantin Belousov2021-05-221-1/+1
| | | | | | | | | Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week X-MFC-Note: struct mount layout Differential revision: https://reviews.freebsd.org/D30325
* Add chr/blk devices support.Fedor Uporov2021-05-071-2/+1
| | | | | | | | | | The dev field is placed into the inode structure. The major/minor numbers conversion to/from linux compatile format happen during on-disk inodes writing/reading. Reviewed by: pfg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29930
* ext2fs: clear write cluster tracking on truncationKonstantin Belousov2021-02-211-0/+1
| | | | | | | | Reviewed by: fsu, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28679
* vfs: drop the de facto curthread argument from VOP_INACTIVEMateusz Guzik2020-10-201-1/+1
| | | | Notes: svn path=/head/; revision=366870
* Add BE architectures support.Fedor Uporov2020-05-171-2/+3
| | | | | | | | | | | | 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
* Rework v_object lifecycle for vnodes.Konstantin Belousov2019-08-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | Current implementation of vnode_create_vobject() and vnode_destroy_vobject() is written so that it prepared to handle the vm object destruction for live vnode. Practically, no filesystems use this, except for some remnants that were present in UFS till today. One of the consequences of that model is that each filesystem must call vnode_destroy_vobject() in VOP_RECLAIM() or earlier, as result all of them get rid of the v_object in reclaim. Move the call to vnode_destroy_vobject() to vgonel() before VOP_RECLAIM(). This makes v_object stable: either the object is NULL, or it is valid vm object till the vnode reclamation. Remove code from vnode_create_vobject() to handle races with the parallel destruction. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D21412 Notes: svn path=/head/; revision=351598
* Remove "struct ucred*" argument from vtruncbufAlan Somers2019-05-241-2/+2
| | | | | | | | | | | | | | | vtruncbuf takes a "struct ucred*" argument. AFAICT, it's been unused ever since that function was first added in r34611. Remove it. Also, remove some "struct ucred" arguments from fuse and nfs functions that were only used by vtruncbuf. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20377 Notes: svn path=/head/; revision=348251
* ext2fs: Initial version of DTrace support.Fedor Uporov2019-04-161-0/+1
| | | | | | | | | | Reviewed by: pfg, gnn MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19848 Notes: svn path=/head/; revision=346267
* Fix EXT2FS_DEBUG definition usage.Fedor Uporov2018-05-131-0/+1
| | | | | | | | | | Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D15394 Notes: svn path=/head/; revision=333584
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Fix physical block number overflow in different places.Fedor Uporov2017-10-241-2/+2
| | | | | | | | Approved by: pfg (mentor) MFC after: 6 months Notes: svn path=/head/; revision=324963
* Add inital extents read-write support.Fedor Uporov2017-10-171-124/+229
| | | | | | | | | | | Approved by: pfg (mentor) MFC after: 6 months RelNotes: Yes Differential Revision: https://reviews.freebsd.org/D12087 Notes: svn path=/head/; revision=324706
* Add check to avoid raw inode iblocks fields overflow in case of huge_file ↵Fedor Uporov2017-09-271-1/+5
| | | | | | | | | | | | | | feature. Use the Linux logic for now. Reviewed by: pfg (mentor) Approved by: pfg (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12131 Notes: svn path=/head/; revision=324064
* ext2fs: add read-write support for Extended Attributes.Pedro F. Giffuni2017-05-031-0/+2
| | | | | | | | | | | | | | | | | Extended attributes and their particular implementation in linux are different from FreeBSD so in this case we have started diverging from the UFS EA implementation, which would be the natural reference. Depending on future progress implementing ACLs this approach may change but for now bring to the tree an implementation that is consistent and can be tested. Submitted by: Fedor Uporov Differential Revision: https://reviews.freebsd.org/D10460 Notes: svn path=/head/; revision=317779
* prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2017-02-151-13/+14
| | | | | | | | | | | | | | | | | | | | | Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency) Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_ Reviewed by: kib, mckusick Obtained from: NetBSD MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9536 Notes: svn path=/head/; revision=313780
* style(9) cleanups.Pedro F. Giffuni2016-12-281-7/+6
| | | | | | | | | Just to reduce some of the issues found with indent(1). MFC after: 1 week Notes: svn path=/head/; revision=310705
* ext2fs: renumber the license clauses to avoid skipping #3.Pedro F. Giffuni2016-12-021-1/+1
| | | | | | | | | | This is to keep consistency with other files, and help license-checking utilities determine the number of clauses that apply. No functional change. Notes: svn path=/head/; revision=309439
* fs/ext2fs: spelling fixes on comment.Pedro F. Giffuni2016-04-291-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298805
* Fix the build when INVARIANTS is defined by restoring `bo`'s definition inEnji Cooper2015-01-191-0/+6
| | | | | | | | | | ext2_truncate(..) and by putting it under INVARIANTS ifdefs X-MFC with: r277354 MFC after: 2 weeks Notes: svn path=/head/; revision=277365
* 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
* ext2fs: Fix old out-of-bounds access.Pedro F. Giffuni2014-12-091-6/+16
| | | | | | | | | | | | | | | | | Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by passing it to a function which accesses it at byte offset 59 using argument 60UL. The issue was inherited from an older FFS implementation and fixed there with by merging UFS2 in r98542. We follow the FFS fix. Discussed with: bde CID: 1007665 MFC after: 3 days Notes: svn path=/head/; revision=275645
* ext2fs: use of tab vs spaces.Pedro F. Giffuni2014-02-281-1/+1
| | | | | | | | | | | | | 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 after: 3 days Notes: svn path=/head/; revision=262623
* Define ext2fs local types and use them.Pedro F. Giffuni2013-08-131-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Add definitions for e2fs_daddr_t, e4fs_daddr_t in addition to the already existing e2fs_lbn_t and adjust them for ext4. Other than making the code more readable these changes should fix problems related to big filesystems. Setting the proper types can be tricky so the process was helped by looking at UFS. In our implementation, logical block numbers can be negative and the code depends on it. In ext2, block numbers are unsigned so it is convenient to keep e2fs_daddr_t unsigned and use the complete 32 bits. In the case of e4fs_daddr_t, while the value should be unsigned, for ext4 we only need to support 48 bits so preserving an extra bit from the sign is not an issue. While here also drop the ext2_setblock() prototype that was never used. Discussed with: mckusick, bde MFC after: 3 weeks Notes: svn path=/head/; revision=254283
* Turn DIAGNOSTICs to INVARIANTS in ext2fs.Pedro F. Giffuni2013-06-121-3/+3
| | | | | | | | | | This is done to be consistent with what other filesystems and particularly ffs already does (see r173464). MFC after: 5 days Notes: svn path=/head/; revision=251658
* - Convert the bufobj lock to rwlock.Jeff Roberson2013-05-311-0/+1
| | | | | | | | | | | | | - Use a shared bufobj lock in getblk() and inmem(). - Convert softdep's lk to rwlock to match the bufobj lock. - Move INFREECNT to b_flags and protect it with the buf lock. - Remove unnecessary locking around bremfree() and BKGRDINPROG. Sponsored by: EMC / Isilon Storage Division Discussed with: mckusick, kib, mdf Notes: svn path=/head/; revision=251171
* ext2fs: Use prototype declarations for function definitionsPedro F. Giffuni2013-02-101-25/+7
| | | | | | | | Submitted by: Christoph Mallon MFC after: 2 weeks Notes: svn path=/head/; revision=246634
* ext2fs: general cleanup.Pedro F. Giffuni2013-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=246258
* Cosmetical off-by-onePedro F. Giffuni2013-01-261-2/+2
| | | | | | | | | | | | Technically, the case when all the blocks are released is not a sanity check. Move further the comment while here. Suggested by: bde MFC after: 3 days Notes: svn path=/head/; revision=245950
* ext2fs: fix a check for negative block numbers.Pedro F. Giffuni2013-01-231-2/+1
| | | | | | | | | | | | The previous change accidentally left the substraction we were trying to avoid in case that i_blocks could become negative. Reported by: bde MFC after: 4 days Notes: svn path=/head/; revision=245844
* ext2fs: make some inode fields match the ext2 spec.Pedro F. Giffuni2013-01-221-2/+4
| | | | | | | | | | | | | | | | | Ext2fs uses unsigned fields in its dinode struct. FreeBSD can have negative values in some of those fields and the inode is meant to interact with the system so we have never respected the unsigned nature of most of those fields. Block numbers and the NFS generation number do not need to be signed so redefine them as unsigned to better match the on-disk information. MFC after: 1 week Notes: svn path=/head/; revision=245820
* ext2fs: Add some DOINGASYNC check to match ffs.Pedro F. Giffuni2013-01-181-5/+9
| | | | | | | | | | This is mostly cosmetical. Reviewed by: bde MFC after: 3 days Notes: svn path=/head/; revision=245612
* Fix style nitKevin Lo2012-09-111-2/+1
| | | | Notes: svn path=/head/; revision=240355
* Remove unused thread argument to vrecycle().Edward Tomasz Napierala2012-04-231-1/+1
| | | | | | | Reviewed by: kib Notes: svn path=/head/; revision=234607
* Remove unused thread argument from vtruncbuf().Edward Tomasz Napierala2012-04-231-1/+1
| | | | | | | Reviewed by: kib Notes: svn path=/head/; revision=234605
* Style cleanups by jh@.Pedro F. Giffuni2011-12-161-4/+4
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=228583
* Sync with several changes in UFS/FFS:John Baldwin2011-04-281-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | - 77115: Implement support for O_DIRECT. - 98425: Fix a performance issue introduced in 70131 that was causing reads before writes even when writing full blocks. - 98658: Rename the BALLOC flags from B_* to BA_* to avoid confusion with the struct buf B_ flags. - 100344: Merge the BA_ and IO_ flags so so that they may both be used in the same flags word. This merger is possible by assigning the IO_ flags to the low sixteen bits and the BA_ flags the high sixteen bits. - 105422: Fix a file-rewrite performance case. - 129545: Implement IO_INVAL in VOP_WRITE() by marking the buffer as "no cache". - Readd the DOINGASYNC() macro and use it to control asynchronous writes. Change i-node updates to honor DOINGASYNC() instead of always being synchronous. - Use a PRIV_VFS_RETAINSUGID check instead of checking cr_uid against 0 directly when deciding whether or not to clear suid and sgid bits. Submitted by: Pedro F. Giffuni giffunip at yahoo Notes: svn path=/head/; revision=221166
* Remove prtactive variable and related printf()s in the vop_inactiveKonstantin Belousov2010-11-191-5/+0
| | | | | | | | | | | and vop_reclaim() methods. They seems to be unused, and the reported situation is normal for the forced unmount. MFC after: 1 week X-MFC-note: keep prtactive symbol in vfs_subr.c Notes: svn path=/head/; revision=215548
* Bring in the ext2fs work done by Aditya Sarawgi during and after Google SummerUlf Lilleengen2010-01-141-0/+537
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> Notes: svn path=/head/; revision=202283