blob: 188ef6ba6836f105a0c4bed6561b0e06a2e8690b [file] [log] [blame]
Tiger Yangcf1d6c72008-08-18 17:11:00 +08001/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * xattr.h
5 *
Tiger Yangc3cb6822008-10-23 16:33:03 +08006 * Copyright (C) 2004, 2008 Oracle. All rights reserved.
Tiger Yangcf1d6c72008-08-18 17:11:00 +08007 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
Tiger Yangc3cb6822008-10-23 16:33:03 +080010 * License version 2 as published by the Free Software Foundation.
Tiger Yangcf1d6c72008-08-18 17:11:00 +080011 *
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.
Tiger Yangcf1d6c72008-08-18 17:11:00 +080016 */
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
Tiger Yang534eadd2008-11-14 11:16:41 +080033struct ocfs2_security_xattr_info {
34 int enable;
35 char *name;
36 void *value;
37 size_t value_len;
38};
39
Tiger Yangcf1d6c72008-08-18 17:11:00 +080040extern struct xattr_handler ocfs2_xattr_user_handler;
41extern struct xattr_handler ocfs2_xattr_trusted_handler;
Tiger Yang923f7f32008-11-14 11:16:27 +080042extern struct xattr_handler ocfs2_xattr_security_handler;
Tiger Yangcf1d6c72008-08-18 17:11:00 +080043extern struct xattr_handler *ocfs2_xattr_handlers[];
44
Tiger Yang0030e002008-10-23 16:33:33 +080045ssize_t ocfs2_listxattr(struct dentry *, char *, size_t);
46int ocfs2_xattr_set(struct inode *, int, const char *, const void *,
47 size_t, int);
Tiger Yang6c3faba2008-11-14 11:16:03 +080048int ocfs2_xattr_set_handle(handle_t *, struct inode *, struct buffer_head *,
49 int, const char *, const void *, size_t, int,
50 struct ocfs2_alloc_context *,
51 struct ocfs2_alloc_context *);
Tiger Yang0030e002008-10-23 16:33:33 +080052int ocfs2_xattr_remove(struct inode *, struct buffer_head *);
Tiger Yang534eadd2008-11-14 11:16:41 +080053int ocfs2_init_security_get(struct inode *, struct inode *,
54 struct ocfs2_security_xattr_info *);
55int ocfs2_init_security_set(handle_t *, struct inode *,
56 struct buffer_head *,
57 struct ocfs2_security_xattr_info *,
58 struct ocfs2_alloc_context *,
59 struct ocfs2_alloc_context *);
60int ocfs2_calc_security_init(struct inode *,
61 struct ocfs2_security_xattr_info *,
62 int *, int *, struct ocfs2_alloc_context **);
Tao Ma0c044f02008-08-18 17:38:50 +080063
Tiger Yangcf1d6c72008-08-18 17:11:00 +080064#endif /* OCFS2_XATTR_H */