diff options
author | Joel Becker <joel.becker@oracle.com> | 2009-08-14 19:04:15 -0700 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-02-26 15:41:10 -0800 |
commit | 199799a3609f6d5bb231a75c2e702afaac805431 (patch) | |
tree | e9addab09c0c86a06dd97251888035cc0ccab202 /net/8021q | |
parent | 18853b95d1fb964b76c3393a12c4d861e7779460 (diff) |
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 <joel.becker@oracle.com>
Diffstat (limited to 'net/8021q')
0 files changed, 0 insertions, 0 deletions