aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 2f8952e4e4c1..420d8e30b184 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -132,6 +132,24 @@ static int ocfs2_xattr_set_entry_index_block(struct inode *inode,
132static int ocfs2_delete_xattr_index_block(struct inode *inode, 132static int ocfs2_delete_xattr_index_block(struct inode *inode,
133 struct buffer_head *xb_bh); 133 struct buffer_head *xb_bh);
134 134
135static inline u16 ocfs2_xattr_buckets_per_cluster(struct ocfs2_super *osb)
136{
137 return (1 << osb->s_clustersize_bits) / OCFS2_XATTR_BUCKET_SIZE;
138}
139
140static inline u16 ocfs2_blocks_per_xattr_bucket(struct super_block *sb)
141{
142 return OCFS2_XATTR_BUCKET_SIZE / (1 << sb->s_blocksize_bits);
143}
144
145static inline u16 ocfs2_xattr_max_xe_in_bucket(struct super_block *sb)
146{
147 u16 len = sb->s_blocksize -
148 offsetof(struct ocfs2_xattr_header, xh_entries);
149
150 return len / sizeof(struct ocfs2_xattr_entry);
151}
152
135static inline const char *ocfs2_xattr_prefix(int name_index) 153static inline const char *ocfs2_xattr_prefix(int name_index)
136{ 154{
137 struct xattr_handler *handler = NULL; 155 struct xattr_handler *handler = NULL;
@@ -832,11 +850,11 @@ cleanup:
832 * Copy an extended attribute into the buffer provided. 850 * Copy an extended attribute into the buffer provided.
833 * Buffer is NULL to compute the size of buffer required. 851 * Buffer is NULL to compute the size of buffer required.
834 */ 852 */
835int ocfs2_xattr_get(struct inode *inode, 853static int ocfs2_xattr_get(struct inode *inode,
836 int name_index, 854 int name_index,
837 const char *name, 855 const char *name,
838 void *buffer, 856 void *buffer,
839 size_t buffer_size) 857 size_t buffer_size)
840{ 858{
841 int ret; 859 int ret;
842 struct ocfs2_dinode *di = NULL; 860 struct ocfs2_dinode *di = NULL;