aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dir-item.c
Commit message (Collapse)AuthorAge
* Btrfs: Pass transaction handle to security and ACL initialization functionsYan, Zheng2009-12-17
| | | | | | | | Pass transaction handle down to security and ACL initialization functions, so we can avoid starting nested transactions Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: change how subvolumes are organizedYan, Zheng2009-09-21
| | | | | | | | | | | | | | | | | | | | | btrfs allows subvolumes and snapshots anywhere in the directory tree. If we snapshot a subvolume that contains a link to other subvolume called subvolA, subvolA can be accessed through both the original subvolume and the snapshot. This is similar to creating hard link to directory, and has the very similar problems. The aim of this patch is enforcing there is only one access point to each subvolume. Only the first directory entry (the one added when the subvolume/snapshot was created) is treated as valid access point. The first directory entry is distinguished by checking root forward reference. If the corresponding root forward reference is missing, we know the entry is not the first one. This patch also adds snapshot/subvolume rename support, the code allows rename subvolume link across subvolumes. Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: leave btree locks spinning more oftenChris Mason2009-03-24
| | | | | | | | | | | | | | | | | | | | btrfs_mark_buffer dirty would set dirty bits in the extent_io tree for the buffers it was dirtying. This may require a kmalloc and it was not atomic. So, anyone who called btrfs_mark_buffer_dirty had to set any btree locks they were holding to blocking first. This commit changes dirty tracking for extent buffers to just use a flag in the extent buffer. Now that we have one and only one extent buffer per page, this can be safely done without losing dirty bits along the way. This also introduces a path->leave_spinning flag that callers of btrfs_search_slot can use to indicate they will properly deal with a path returned where all the locks are spinning instead of blocking. Many of the btree search callers now expect spinning paths, resulting in better btree concurrency overall. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix checkpatch.pl warningsChris Mason2009-01-05
| | | | | | | There were many, most are fixed now. struct-funcs.c generates some warnings but these are bogus. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: add and improve commentsChris Mason2008-09-29
| | | | | | | | | | | This improves the comments at the top of many functions. It didn't dive into the guts of functions because I was trying to avoid merging problems with the new allocator and back reference work. extent-tree.c and volumes.c were both skipped, and there is definitely more work todo in cleaning and commenting the code. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Add a write ahead tree log to optimize synchronous operationsChris Mason2008-09-25
| | | | | | | | | | | File syncs and directory syncs are optimized by copying their items into a special (copy-on-write) log tree. There is one log tree per subvolume and the btrfs super block points to a tree of log tree roots. After a crash, items are copied out of the log tree and back into the subvolume. See tree-log.c for all the details. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: implement memory reclaim for leaf reference cacheYan2008-09-25
| | | | | | | | | | | | | | The memory reclaiming issue happens when snapshot exists. In that case, some cache entries may not be used during old snapshot dropping, so they will remain in the cache until umount. The patch adds a field to struct btrfs_leaf_ref to record create time. Besides, the patch makes all dead roots of a given snapshot linked together in order of create time. After a old snapshot was completely dropped, we check the dead root list and remove all cache entries created before the oldest dead root in the list. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Implement new dir index formatJosef Bacik2008-09-25
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: unaligned access fixesDavid Miller2008-09-25
| | | | | | | | | | | | | Btrfs set/get macros lose type information needed to avoid unaligned accesses on sparc64. ere is a patch for the kernel bits which fixes most of the unaligned accesses on sparc64. btrfs_name_hash is modified to return the hash value instead of getting a return location via a (potentially unaligned) pointer. Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Implement ACLs setting and gettingYan2008-09-25
| | | | | | ACLs are stored but not used for permission checks (yet) Signed-off-by: Chris Mason <chris.mason@oracle.com>
* xattr support for btrfsJosef Bacik2008-09-25
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Fix a number of inline extent problems that Yan Zheng reported.Chris Mason2008-09-25
| | | | | | | | | | | | | | | | | | The fixes do a number of things: 1) Most btrfs_drop_extent callers will try to leave the inline extents in place. It can truncate bytes off the beginning of the inline extent if required. 2) writepage can now update the inline extent, allowing mmap writes to go directly into the inline extent. 3) btrfs_truncate_in_transaction truncates inline extents 4) extent_map.c fixed to not merge inline extent mappings and hole mappings together Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Create extent_buffer interface for large blocksizesChris Mason2008-09-25
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: trivial include fixupsZach Brown2007-07-11
| | | | | | | | | | | Almost none of the files including module.h need to do so, remove them. Include sched.h in extent-tree.c to silence a warning about cond_resched() being undeclared. Signed-off-by: Zach Brown <zach.brown@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Audit callers and return codes to make sure -ENOSPC gets up the stackChris Mason2007-06-22
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs: Code cleanupAneesh2007-06-13
| | | | | | | | | | | Attaching below is some of the code cleanups that i came across while reading the code. a) alloc_path already calls init_path. b) Mention that btrfs_inode is the in memory copy.Ext4 have ext4_inode_info as the in memory copy ext4_inode as the disk copy Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: add GPLv2Chris Mason2007-06-12
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: renameChris Mason2007-05-23
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: fix page cache memory leakChris Mason2007-05-02
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: directory inode index is backChris Mason2007-04-19
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: working file_write, reorganized key flagsChris Mason2007-04-18
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: rework csums and extent item orderingChris Mason2007-04-17
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: snapshot progressChris Mason2007-04-10
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: start of support for many FS volumesChris Mason2007-04-06
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: dirindex optimizationsChris Mason2007-04-05
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: finish off inode indexing in dirs, add overflowsChris Mason2007-04-05
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: more inode indexed directory workChris Mason2007-04-05
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: add dir inode indexChris Mason2007-04-04
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: dynamic allocation of path structChris Mason2007-04-02
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: corruption hunt continuesChris Mason2007-03-30
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: hunting slab corruptionChris Mason2007-03-30
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Add generation number to btrfs_header, readdir fixes, hash collision fixesChris Mason2007-03-23
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* btrfs_create, btrfs_write_super, btrfs_sync_fsChris Mason2007-03-23
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Mountable btrfs, with readdirChris Mason2007-03-22
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: initial move to kernel module landChris Mason2007-03-21
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: transaction handles everywhereChris Mason2007-03-16
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: add a name_len to dir items, reorder keyChris Mason2007-03-16
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: directory testing code and dir item fixesChris Mason2007-03-15
| | | | Signed-off-by: Chris Mason <chris.mason@oracle.com>
* Btrfs: Use a chunk of the key flags to record the item type.Chris Mason2007-03-15
Add (untested and simple) directory item code Fix comp_keys to use the new key ordering Add btrfs_insert_empty_item Signed-off-by: Chris Mason <chris.mason@oracle.com>