summaryrefslogtreecommitdiffstats
path: root/sys/fs/ext2fs
Commit message (Collapse)AuthorAgeFilesLines
* Small typo.pfg2013-08-081-1/+1
| | | | MFC after: 3 days
* Add license for the half MD4 algorithm used in ext2_half_md4().pfg2013-08-011-5/+29
| | | | | | | | | | The htree implementation uses code derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm. Add a proper licensing statement for the code and clarify the corresponding comments. Approved by: core (hrs)
* ext2fs: Return EINVAL for negative uio_offset as in UFS.pfg2013-07-251-8/+2
| | | | | | | While here drop old comment that doesn't really apply. MFC after: 1 month Discussed with: gleb
* ext2fs: Drop a check that wan't supposed to be in r253651.pfg2013-07-251-4/+1
| | | | MFC after: 1 month
* ext2fs: Don't assume that on-disk format of a directory is the samepfg2013-07-251-81/+99
| | | | | | | | | | | | | | | | | | | | as in <sys/dirent.h> ext2_readdir() has always been very fs specific and different with respect to its ufs_ counterpart. Recent changes from UFS have made it possible to share more closely the implementation. MFUFS r252438: Always start parsing at DIRBLKSIZ aligned offset, skip first entries if uio_offset is not DIRBLKSIZ aligned. Return EINVAL if buffer is too small for single entry. Preallocate buffer for cookies. Skip entries with zero inode number. Reviewed by: gleb, Zheng Liu MFC after: 1 month
* Implement 1003.1-2001 pathconf() keys.pfg2013-07-101-9/+44
| | | | | | This is based on r106058 in UFS. MFC after: 1 month
* Reinstate the assertion from r253045.pfg2013-07-091-2/+2
| | | | | | | UFS r232732 reverted the change as the real problem was to be fixed at the syscall level. Reported by: bde
* Enhancement when writing an entire block of a file.pfg2013-07-091-9/+20
| | | | | | | | | | | Merge from UFS r231313: This change first attempts the uiomove() to the newly allocated (and dirty) buffer and only zeros it if the uiomove() fails. The effect is to eliminate the gratuitous zeroing of the buffer in the usual case where the uiomove() successfully fills it. MFC after: 3 days
* Avoid a panic and return EINVAL instead.pfg2013-07-081-2/+2
| | | | | | | Merge from UFS r232692: syscall() fuzzing can trigger this panic. MFC after: 3 days
* Implement SEEK_HOLE/SEEK_DATA for ext2fs.pfg2013-07-071-0/+20
| | | | | | Merged from r236044 on UFS. MFC after: 3 days
* Fix some typos.pfg2013-07-071-3/+3
| | | | MFC after: 1 week
* Initial implementation of the HTree directory index.pfg2013-07-069-115/+1561
| | | | | | | | | | | | | | | | | | | 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
* Bring some updates from ufs_lookup to ext2fs.pfg2013-06-291-8/+11
| | | | | | | | | | | | | | | | | | | | | | r156418: Don't set IN_CHANGE and IN_UPDATE on inodes for potentially suspended file systems. This could cause deadlocks when creating snapshots. (We can't do snapshots on ext2fs but it is useful to keep things in sync). r183079: - Only set i_offset in the parent directory's i-node during a lookup for non-LOOKUP operations. - Relax a VOP assertion for a DELETE lookup. r187528: Move the code from ufs_lookup.c used to do dotdot lookup, into the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the ".." entry in lookup routine. MFC after: 5 days
* Minor sorting.pfg2013-06-261-1/+1
| | | | MFC after: 3 days
* Define and use e2fs_lbn_t in ext2fs.pfg2013-06-237-12/+19
| | | | | | | | | | | | | | | | | | In line to what is done in UFS, define an internal type e2fs_lbn_t for the logical block numbers. This change is basically a no-op as the new type is unchanged (int32_t) but it may be useful as bumping this may be required for ext4fs. Also, as pointed out by Bruce Evans: -Use daddr_t for daddr in ext2_bmaparray(). This seems to improve reliability with the reallocblks option. - Add a cast to the fsbtodb() macro as in UFS. Reviewed by: bde MFC after: 3 days
* Rename some prefixes in the Block Group Descriptor fields to ext4bgd_pfg2013-06-201-6/+6
| | | | | | | Change prefix to avoid confusion and denote that these fields are generally only available starting with ext4. MFC after: 3 days
* More ext2fs header cleanups:pfg2013-06-182-12/+12
| | | | | | | - Set MAXMNTLEN nearer to where it is used. - Move EXT2_LINK_MAX to ext2_dir.h . MFC after: 3 days
* Rename remaining DIAGNOSTIC to INVARIANTS.pfg2013-06-171-1/+1
| | | | MFC after: 3 days
* Re-sort ext2fs headers to make things easier to find.pfg2013-06-166-56/+33
| | | | | | | | | | | | | | In the ext2fs driver we have a mixture of headers: - The ext2_ prefixed headers have strong influence from NetBSD and are carry specific ext2/3/4 information. - The unprefixed headers are inspired on UFS and carry implementation specific information. Do some small adjustments so that the information is easier to find coming from either UFS or the NetBSD implementation. MFC after: 3 days
* Relax some unnecessary unsigned type changes in ext2fs.pfg2013-06-132-10/+10
| | | | | | | | | | | | | While the changes in r245820 are in line with the ext2 spec, the code derived from UFS can use negative values so it is better to relax some types to keep them as they were, and somewhat more similar to UFS. While here clean some casts. Some of the original types are still wrong and will require more work. Discussed with: bde MFC after: 3 days
* Turn DIAGNOSTICs to INVARIANTS in ext2fs.pfg2013-06-125-16/+16
| | | | | | | This is done to be consistent with what other filesystems and particularly ffs already does (see r173464). MFC after: 5 days
* s/file system/filesystem/gpfg2013-06-113-8/+8
| | | | | | Based on r96755 from UFS. MFC after: 3 days
* e2fs_bpg and e2fs_isize are always unsigned.pfg2013-06-091-2/+2
| | | | | | | | | | The superblock in ext2fs defines all the fields as unsigned but for some reason the in-memory superblock was carrying e2fs_bpg and e2fs_isize as signed. We should preserve the specified types for consistency. MFC after: 5 days
* ext2fs: space vs tab.pfg2013-06-032-2/+2
| | | | | Obtained from: Christoph Mallon MFC after: 3 days
* ext2fs: Small cosmetic fixes.pfg2013-06-032-2/+3
| | | | | | | Make a long macro readable and sort a header. Obtained from: Christoph Mallon MFC after: 3 days
* ext2fs: Update Block Group Descriptor struct.pfg2013-06-031-3/+7
| | | | | | | | | Uncover some, previously reserved, fields that are used by Ext4. These are currently unused but it is good to have them for future reference. Reviewed by: bde MFC after: 3 days
* - Convert the bufobj lock to rwlock.jeff2013-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
* Prepare to replace the buf splay with a trie:jeff2013-04-061-2/+0
| | | | | | | | | | | | | | | | - Don't insert BKGRDMARKER bufs into the splay or dirty/clean buf lists. No consumers need to find them there and it complicates the tree. These flags are all FFS specific and could be moved out of the buf cache. - Use pbgetvp() and pbrelvp() to associate the background and journal bufs with the vp. Not only is this much cheaper it makes more sense for these transient bufs. - Fix the assertions in pbget* and pbrel*. It's not safe to check list pointers which were never initialized. Use the BX flags instead. We also check B_PAGING in reassignbuf() so this should cover all cases. Discussed with: kib, mckusick, attilio Sponsored by: EMC / Isilon Storage Division
* Add currently unused flag argument to the cluster_read(),kib2013-03-142-5/+6
| | | | | | | | 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
* ext2fs: Use prototype declarations for function definitionspfg2013-02-108-304/+65
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE.pfg2013-02-082-2/+1
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: make e2fs_maxcontig local and remove tautological check.pfg2013-02-082-7/+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
* Remove unused MAXSYMLINKLEN macro.pfg2013-02-081-1/+0
| | | | | | Reviewed by: mckusick PR: kern/175794 MFC after: 1 week
* ext2fs: move assignment where it is not dead.pfg2013-02-051-2/+3
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: Remove unused em_e2fsb definition..pfg2013-02-051-1/+0
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: Remove useless rootino local variable.pfg2013-02-051-4/+3
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: Correct off-by-one errors in FFTODT() and DDTOFT().pfg2013-02-051-2/+2
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: Use nitems().pfg2013-02-051-6/+4
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: Use EXT2_LINK_MAX instead of LINK_MAXpfg2013-02-051-5/+5
| | | | | Submitted by: Christoph Mallon MFC after: 2 weeks
* ext2fs: general cleanup.pfg2013-02-027-61/+17
| | | | | | | | | | | | | | | | | | | | | | - 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
* Clean some 'svn:executable' properties in the tree.pfg2013-01-263-0/+0
| | | | | Submitted by: Christoph Mallon MFC after: 3 days
* Cosmetical off-by-onepfg2013-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
* ext2fs: fix a check for negative block numbers.pfg2013-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
* ext2fs: make some inode fields match the ext2 spec.pfg2013-01-224-9/+11
| | | | | | | | | | | | | | 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
* ext2fs: temporarily disable the reallocation code.pfg2013-01-221-2/+2
| | | | | | | | | Testing with fsx has revealed problems and in order to hunt the bugs properly we need reduce the complexity. This seems to help but is not a complete solution. MFC after: 3 days
* ext2fs: Add some DOINGASYNC check to match ffs.pfg2013-01-181-5/+9
| | | | | | | This is mostly cosmetical. Reviewed by: bde MFC after: 3 days
* ext2fs: cleanup de dinode structure.pfg2013-01-071-20/+19
| | | | | | | | | It was plagued with style errors and the offsets had been lost. While here took the time to update the fields according to the latest ext4 documentation. Reviewed by: bde MFC after: 3 days
* More constant renaming in preparation for newer features.pfg2012-12-204-24/+25
| | | | | | | | | | | | | | | 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
* Update some definitions or make them match NetBSD's headers.pfg2012-11-282-6/+20
| | | | | | | | | | | | | | Bring several definitions required for newer ext4 features. Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it is not being used yet and the new name is more compatible with NetBSD and Linux. This change is purely cosmetic and has no effect on the real code. Obtained from: NetBSD MFC after: 3 days
OpenPOWER on IntegriCloud