]>
Commit | Line | Data |
---|---|---|
1802d0be | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
cf1d6c76 TY |
2 | /* -*- mode: c; c-basic-offset: 8; -*- |
3 | * vim: noexpandtab sw=8 ts=8 sts=0: | |
4 | * | |
5 | * xattr.h | |
6 | * | |
c3cb6827 | 7 | * Copyright (C) 2004, 2008 Oracle. All rights reserved. |
cf1d6c76 TY |
8 | */ |
9 | ||
10 | #ifndef OCFS2_XATTR_H | |
11 | #define OCFS2_XATTR_H | |
12 | ||
13 | #include <linux/init.h> | |
14 | #include <linux/xattr.h> | |
15 | ||
16 | enum ocfs2_xattr_type { | |
17 | OCFS2_XATTR_INDEX_USER = 1, | |
18 | OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS, | |
19 | OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT, | |
20 | OCFS2_XATTR_INDEX_TRUSTED, | |
21 | OCFS2_XATTR_INDEX_SECURITY, | |
22 | OCFS2_XATTR_MAX | |
23 | }; | |
24 | ||
534eaddd TY |
25 | struct ocfs2_security_xattr_info { |
26 | int enable; | |
9548906b | 27 | const char *name; |
534eaddd TY |
28 | void *value; |
29 | size_t value_len; | |
30 | }; | |
31 | ||
537d81ca SH |
32 | extern const struct xattr_handler ocfs2_xattr_user_handler; |
33 | extern const struct xattr_handler ocfs2_xattr_trusted_handler; | |
34 | extern const struct xattr_handler ocfs2_xattr_security_handler; | |
537d81ca | 35 | extern const struct xattr_handler *ocfs2_xattr_handlers[]; |
cf1d6c76 | 36 | |
0030e001 | 37 | ssize_t ocfs2_listxattr(struct dentry *, char *, size_t); |
4e3e9d02 TY |
38 | int ocfs2_xattr_get_nolock(struct inode *, struct buffer_head *, int, |
39 | const char *, void *, size_t); | |
0030e001 TY |
40 | int ocfs2_xattr_set(struct inode *, int, const char *, const void *, |
41 | size_t, int); | |
6c3faba4 TY |
42 | int ocfs2_xattr_set_handle(handle_t *, struct inode *, struct buffer_head *, |
43 | int, const char *, const void *, size_t, int, | |
44 | struct ocfs2_alloc_context *, | |
45 | struct ocfs2_alloc_context *); | |
8b2c0dba TM |
46 | int ocfs2_has_inline_xattr_value_outside(struct inode *inode, |
47 | struct ocfs2_dinode *di); | |
0030e001 | 48 | int ocfs2_xattr_remove(struct inode *, struct buffer_head *); |
534eaddd | 49 | int ocfs2_init_security_get(struct inode *, struct inode *, |
2a7dba39 | 50 | const struct qstr *, |
534eaddd TY |
51 | struct ocfs2_security_xattr_info *); |
52 | int ocfs2_init_security_set(handle_t *, struct inode *, | |
53 | struct buffer_head *, | |
54 | struct ocfs2_security_xattr_info *, | |
55 | struct ocfs2_alloc_context *, | |
56 | struct ocfs2_alloc_context *); | |
57 | int ocfs2_calc_security_init(struct inode *, | |
58 | struct ocfs2_security_xattr_info *, | |
59 | int *, int *, struct ocfs2_alloc_context **); | |
89c38bd0 | 60 | int ocfs2_calc_xattr_init(struct inode *, struct buffer_head *, |
67697cbd | 61 | umode_t, struct ocfs2_security_xattr_info *, |
9b7895ef | 62 | int *, int *, int *); |
01225596 | 63 | |
2a50a743 JB |
64 | /* |
65 | * xattrs can live inside an inode, as part of an external xattr block, | |
66 | * or inside an xattr bucket, which is the leaf of a tree rooted in an | |
67 | * xattr block. Some of the xattr calls, especially the value setting | |
68 | * functions, want to treat each of these locations as equal. Let's wrap | |
69 | * them in a structure that we can pass around instead of raw buffer_heads. | |
70 | */ | |
71 | struct ocfs2_xattr_value_buf { | |
72 | struct buffer_head *vb_bh; | |
73 | ocfs2_journal_access_func vb_access; | |
74 | struct ocfs2_xattr_value_root *vb_xv; | |
75 | }; | |
76 | ||
0129241e TM |
77 | int ocfs2_xattr_attach_refcount_tree(struct inode *inode, |
78 | struct buffer_head *fe_bh, | |
79 | struct ocfs2_caching_info *ref_ci, | |
80 | struct buffer_head *ref_root_bh, | |
81 | struct ocfs2_cached_dealloc_ctxt *dealloc); | |
2999d12f TM |
82 | int ocfs2_reflink_xattrs(struct inode *old_inode, |
83 | struct buffer_head *old_bh, | |
84 | struct inode *new_inode, | |
0fe9b66c TM |
85 | struct buffer_head *new_bh, |
86 | bool preserve_security); | |
87 | int ocfs2_init_security_and_acl(struct inode *dir, | |
2a7dba39 | 88 | struct inode *inode, |
c25a1e06 | 89 | const struct qstr *qstr); |
cf1d6c76 | 90 | #endif /* OCFS2_XATTR_H */ |