android_kernel_xiaomi_sm7250/fs/ocfs2
Tao Ma 012255961c ocfs2: Enable xattr set in index btree
Where the previous patches added the ability of list/get xattr in buckets
for ocfs2, this patch enables ocfs2 to store large numbers of EAs.

The original design doc is written by Mark Fasheh, and it can be found in
http://oss.oracle.com/osswiki/OCFS2/DesignDocs/IndexedEATrees. I only had to
make small modifications to it.

First, because the bucket size is 4K, a new field named xh_free_start is added
in ocfs2_xattr_header to indicate the next valid name/value offset in a bucket.
It is used when we store new EA name/value. With this field, we can find the
place more quickly and what's more, we don't need to sort the name/value every
time to let the last entry indicate the next unused space. This makes the
insert operation more efficient for blocksizes smaller than 4k.

Because of the new xh_free_start, another field named as xh_name_value_len is
also added in ocfs2_xattr_header. It records the total length of all the
name/values in the bucket. We need this so that we can check it and defragment
the bucket if there is not enough contiguous free space.

An xattr insertion looks like this:
1. xattr_index_block_find: find the right bucket by the name_hash, say bucketA.
2. check whether there is enough space in bucketA. If yes, insert it directly
   and modify xh_free_start and xh_name_value_len accordingly. If not, check
   xh_name_value_len to see whether we can store this by defragment the bucket.
   If yes, defragment it and go on insertion.
3. If defragement doesn't work, check whether there is new empty bucket in
   the clusters within this extent record. If yes, init the new bucket and move
   all the buckets after bucketA one by one to the next bucket. Move half of the
   entries in bucketA to the next bucket and go on insertion.
4. If there is no new bucket, grow the extent tree.

As for xattr deletion, we will delete an xattr bucket when all it's xattrs
are removed and move all the buckets after it to the previous one. When all
the xattr buckets in an extend record are freed, free this extend records
from ocfs2_xattr_tree.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
2008-10-13 16:57:03 -07:00
..
cluster ocfs2: Add extent tree operation for xattr value btrees 2008-10-13 16:57:01 -07:00
dlm SL*B: drop kmem cache argument from constructor 2008-07-26 12:00:07 -07:00
alloc.c ocfs2: Optionally limit extent size in ocfs2_insert_extent() 2008-10-13 16:57:03 -07:00
alloc.h ocfs2: Optionally limit extent size in ocfs2_insert_extent() 2008-10-13 16:57:03 -07:00
aops.c ocfs2: Add extent tree operation for xattr value btrees 2008-10-13 16:57:01 -07:00
aops.h ocfs2: convert to new aops 2007-10-16 09:42:58 -07:00
buffer_head_io.c ocfs2: clean up bh null checks 2008-01-25 15:05:48 -08:00
buffer_head_io.h [PATCH 1/2] ocfs2: Add group extend for online resize 2008-01-25 14:53:35 -08:00
dcache.c ocfs2: Remove mount/unmount votes 2008-01-25 14:45:34 -08:00
dcache.h
dir.c ocfs2: Add extent tree operation for xattr value btrees 2008-10-13 16:57:01 -07:00
dir.h ocfs2: Rename cleanups 2007-10-12 11:54:38 -07:00
dlmglue.c ocfs2: fix printk format warnings with OCFS2_FS_STATS=n 2008-07-14 13:57:14 -07:00
dlmglue.h ocfs2: Break out stackglue into modules. 2008-04-18 08:56:05 -07:00
export.c ocfs2: Silence false lockdep warnings 2008-01-25 15:05:44 -08:00
export.h exportfs: make struct export_operations const 2007-10-22 08:13:21 -07:00
extent_map.c ocfs2: Add extent tree operation for xattr value btrees 2008-10-13 16:57:01 -07:00
extent_map.h ocfs2: Add extent tree operation for xattr value btrees 2008-10-13 16:57:01 -07:00
file.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
file.h ocfs2: Make high level btree extend code generic 2008-10-13 13:57:59 -07:00
heartbeat.c ocfs2: Move o2hb functionality into the stack glue. 2008-04-18 08:56:04 -07:00
heartbeat.h ocfs2: Move o2hb functionality into the stack glue. 2008-04-18 08:56:04 -07:00
inode.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
inode.h ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
ioctl.c [PATCH] r/o bind mounts: elevate write count for ioctls() 2008-04-19 00:29:24 -04:00
ioctl.h ocfs2: Convert ocfs2 over to unlocked_ioctl 2008-04-18 08:56:11 -07:00
journal.c ocfs2: Fix sleep-with-spinlock recovery regression 2008-08-22 11:08:38 -07:00
journal.h ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
localalloc.c ocfs2: track local alloc state via debugfs 2008-10-13 13:57:58 -07:00
localalloc.h ocfs2: throttle back local alloc when low on disk space 2008-10-13 13:57:57 -07:00
locks.c ocfs2: POSIX file locks support 2008-10-13 13:57:57 -07:00
locks.h ocfs2: POSIX file locks support 2008-10-13 13:57:57 -07:00
Makefile ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
mmap.c ocfs2: Rename ocfs2_meta_[un]lock 2008-01-25 14:46:01 -08:00
mmap.h
namei.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
namei.h ocfs2: Move directory manipulation code into dir.c 2007-10-12 11:54:36 -07:00
ocfs1_fs_compat.h fs/: Spelling fixes 2008-02-03 17:33:42 +02:00
ocfs2_fs.h ocfs2: Add xattr bucket iteration for large numbers of EAs 2008-10-13 16:57:03 -07:00
ocfs2_lockid.h ocfs2: Change mlog_bug_on to BUG_ON in ocfs2_lockid.h 2008-04-18 08:56:07 -07:00
ocfs2_lockingver.h ocfs2: Negotiate locking protocol versions. 2008-02-06 16:11:29 -08:00
ocfs2.h ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
resize.c ocfs2: Fix an endian bug in online resize. 2008-03-10 15:14:07 -07:00
resize.h [PATCH 2/2] ocfs2: Implement group add for online resize 2008-01-25 15:04:24 -08:00
slot_map.c ocfs2: Abstract out node number queries. 2008-04-18 08:56:04 -07:00
slot_map.h ocfs2: De-magic the in-memory slot map. 2008-04-18 08:56:03 -07:00
stack_o2cb.c ocfs2: Remove ->hangup() from stack glue operations. 2008-06-16 10:46:52 -07:00
stack_user.c ocfs2: POSIX file locks support 2008-10-13 13:57:57 -07:00
stackglue.c ocfs2: POSIX file locks support 2008-10-13 13:57:57 -07:00
stackglue.h ocfs2: POSIX file locks support 2008-10-13 13:57:57 -07:00
suballoc.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
suballoc.h ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
super.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
super.h ocfs2: use s_maxbytes directly in ocfs2_change_file_space() 2007-08-09 17:25:07 -07:00
symlink.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
symlink.h
sysfile.c ocfs2: Silence false lockdep warnings 2008-01-25 15:05:44 -08:00
sysfile.h
uptodate.c ocfs2: Add helper function in uptodate.c for removing xattr clusters 2008-10-13 13:57:59 -07:00
uptodate.h ocfs2: Add helper function in uptodate.c for removing xattr clusters 2008-10-13 13:57:59 -07:00
ver.c ocfs2: bump version number 2008-01-25 15:05:46 -08:00
ver.h
xattr_trusted.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
xattr_user.c ocfs2: Add extended attribute support 2008-10-13 16:57:02 -07:00
xattr.c ocfs2: Enable xattr set in index btree 2008-10-13 16:57:03 -07:00
xattr.h ocfs2: Enable xattr set in index btree 2008-10-13 16:57:03 -07:00