From: Joel Becker Date: Sat, 15 Aug 2009 02:04:15 +0000 (-0700) Subject: ocfs2: Wrap calculation of name+value pair size. X-Git-Tag: v2.6.34-rc1~214^2~28 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=199799a3609f6d5bb231a75c2e702afaac805431;p=pandora-kernel.git ocfs2: Wrap calculation of name+value pair size. An ocfs2 xattr entry stores the text name and value as a pair in the storage area. Obviously names and values can be variable-sized. If a value is too large for the entry storage, a tree root is stored instead. The name+value pair is also padded. Because of this, there are a million places in the code that do: if (needs_external_tree(value_size) namevalue_size = pad(name_size) + tree_root_size; else namevalue_size = pad(name_size) + pad(value_size); Let's create some convenience functions to make the code more readable. There are three forms. The first takes the raw sizes. The second takes an ocfs2_xattr_info structure. The third takes an existing ocfs2_xattr_entry. Signed-off-by: Joel Becker --- Reading git-diff-tree failed