summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dir-item.c
AgeCommit message (Collapse)AuthorFilesLines
2009-12-17Btrfs: Pass transaction handle to security and ACL initialization functionsYan, Zheng1-12/+7
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>
2009-09-21Btrfs: change how subvolumes are organizedYan, Zheng1-0/+47
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 Mason1-0/+3
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 Mason1-1/+1
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 Mason1-0/+41
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 Mason1-0/+3
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 cacheYan1-1/+0
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 Bacik1-2/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: unaligned access fixesDavid Miller1-8/+4
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 gettingYan1-0/+3
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 Bacik1-6/+94
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-09-25Btrfs: Fix a number of inline extent problems that Yan Zheng reported.Chris Mason1-1/+1
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 Mason1-46/+56
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-07-11Btrfs: trivial include fixupsZach Brown1-1/+0
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 Mason1-3/+3
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-06-13btrfs: Code cleanupAneesh1-1/+0
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 Mason1-0/+18
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-05-23Btrfs: renameChris Mason1-6/+21
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-05-02Btrfs: fix page cache memory leakChris Mason1-5/+6
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-19Btrfs: directory inode index is backChris Mason1-60/+144
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-18Btrfs: working file_write, reorganized key flagsChris Mason1-70/+0
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-17Btrfs: rework csums and extent item orderingChris Mason1-9/+19
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-10Btrfs: snapshot progressChris Mason1-2/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-06Btrfs: start of support for many FS volumesChris Mason1-5/+9
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-05Btrfs: dirindex optimizationsChris Mason1-1/+4
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-05Btrfs: finish off inode indexing in dirs, add overflowsChris Mason1-5/+69
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-05Btrfs: more inode indexed directory workChris Mason1-0/+18
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-04Btrfs: add dir inode indexChris Mason1-0/+19
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-04-02Btrfs: dynamic allocation of path structChris Mason1-8/+10
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-30Btrfs: corruption hunt continuesChris Mason1-4/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-30Btrfs: hunting slab corruptionChris Mason1-0/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-23Add generation number to btrfs_header, readdir fixes, hash collision fixesChris Mason1-2/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-23btrfs_create, btrfs_write_super, btrfs_sync_fsChris Mason1-1/+2
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-22Mountable btrfs, with readdirChris Mason1-10/+7
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-21Btrfs: initial move to kernel module landChris Mason1-5/+7
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-16Btrfs: transaction handles everywhereChris Mason1-8/+12
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-16Btrfs: add a name_len to dir items, reorder keyChris Mason1-9/+5
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2007-03-15Btrfs: directory testing code and dir item fixesChris Mason1-41/+17
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 Mason1-0/+102
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>