ocfs2: fix license in xattr
[deliverable/linux.git] / fs / ocfs2 / xattr.h
CommitLineData
cf1d6c76
TY
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * xattr.h
5 *
c3cb6827 6 * Copyright (C) 2004, 2008 Oracle. All rights reserved.
cf1d6c76
TY
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
c3cb6827 10 * License version 2 as published by the Free Software Foundation.
cf1d6c76
TY
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
cf1d6c76
TY
16 */
17
18#ifndef OCFS2_XATTR_H
19#define OCFS2_XATTR_H
20
21#include <linux/init.h>
22#include <linux/xattr.h>
23
24enum ocfs2_xattr_type {
25 OCFS2_XATTR_INDEX_USER = 1,
26 OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS,
27 OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT,
28 OCFS2_XATTR_INDEX_TRUSTED,
29 OCFS2_XATTR_INDEX_SECURITY,
30 OCFS2_XATTR_MAX
31};
32
33extern struct xattr_handler ocfs2_xattr_user_handler;
34extern struct xattr_handler ocfs2_xattr_trusted_handler;
35
36extern ssize_t ocfs2_listxattr(struct dentry *, char *, size_t);
37extern int ocfs2_xattr_get(struct inode *, int, const char *, void *, size_t);
38extern int ocfs2_xattr_set(struct inode *, int, const char *, const void *,
39 size_t, int);
40extern int ocfs2_xattr_remove(struct inode *inode, struct buffer_head *di_bh);
41extern struct xattr_handler *ocfs2_xattr_handlers[];
42
0c044f0b
TM
43static inline u16 ocfs2_xattr_buckets_per_cluster(struct ocfs2_super *osb)
44{
45 return (1 << osb->s_clustersize_bits) / OCFS2_XATTR_BUCKET_SIZE;
46}
47
48static inline u16 ocfs2_blocks_per_xattr_bucket(struct super_block *sb)
49{
50 return OCFS2_XATTR_BUCKET_SIZE / (1 << sb->s_blocksize_bits);
51}
01225596
TM
52
53static inline u16 ocfs2_xattr_max_xe_in_bucket(struct super_block *sb)
54{
55 u16 len = sb->s_blocksize -
56 offsetof(struct ocfs2_xattr_header, xh_entries);
57
58 return len / sizeof(struct ocfs2_xattr_entry);
59}
cf1d6c76 60#endif /* OCFS2_XATTR_H */
This page took 0.071777 seconds and 5 git commands to generate.