aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/dir-item.c
AgeCommit message (Collapse)Author
2009-09-21Btrfs: change how subvolumes are organizedYan, Zheng
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>
2009-03-24Btrfs: leave btree locks spinning more oftenChris Mason
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>
2009-01-05Btrfs: Fix checkpatch.pl warningsChris Mason
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>
2008-09-29Btrfs: add and improve commentsChris Mason
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>
2008-09-25Btrfs: Add a write ahead tree log to optimize synchronous operationsChris Mason
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>
2008-09-25Btrfs: implement memory reclaim for leaf reference cacheYan
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>
2008-09-25Btrfs: Implement new dir index formatJosef Bacik
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: unaligned access fixesDavid Miller
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>
2008-09-25Btrfs: Implement ACLs setting and gettingYan
ACLs are stored but not used for permission checks (yet) Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25xattr support for btrfsJosef Bacik
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix a number of inline extent problems that Yan Zheng reported.Chris Mason
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>
2008-09-25Btrfs: Create extent_buffer interface for large blocksizesChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-07-11Btrfs: trivial include fixupsZach Brown
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>
2007-06-22Btrfs: Audit callers and return codes to make sure -ENOSPC gets up the stackChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-13btrfs: Code cleanupAneesh
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>
2007-06-12Btrfs: add GPLv2Chris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-05-23Btrfs: renameChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-05-02Btrfs: fix page cache memory leakChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-19Btrfs: directory inode index is backChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-18Btrfs: working file_write, reorganized key flagsChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-17Btrfs: rework csums and extent item orderingChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-10Btrfs: snapshot progressChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-06Btrfs: start of support for many FS volumesChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-05Btrfs: dirindex optimizationsChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-05Btrfs: finish off inode indexing in dirs, add overflowsChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-05Btrfs: more inode indexed directory workChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-04Btrfs: add dir inode indexChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-02Btrfs: dynamic allocation of path structChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-30Btrfs: corruption hunt continuesChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-30Btrfs: hunting slab corruptionChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-23Add generation number to btrfs_header, readdir fixes, hash collision fixesChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-23btrfs_create, btrfs_write_super, btrfs_sync_fsChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-22Mountable btrfs, with readdirChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-21Btrfs: initial move to kernel module landChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-16Btrfs: transaction handles everywhereChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-16Btrfs: add a name_len to dir items, reorder keyChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-15Btrfs: directory testing code and dir item fixesChris Mason
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-15Btrfs: Use a chunk of the key flags to record the item type.Chris Mason
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>