Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
xattr.h
Go to the documentation of this file.
1 /* -*- mode: c; c-basic-offset: 8; -*-
2  * vim: noexpandtab sw=8 ts=8 sts=0:
3  *
4  * xattr.h
5  *
6  * Copyright (C) 2004, 2008 Oracle. All rights reserved.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public
10  * License version 2 as published by the Free Software Foundation.
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.
16  */
17 
18 #ifndef OCFS2_XATTR_H
19 #define OCFS2_XATTR_H
20 
21 #include <linux/init.h>
22 #include <linux/xattr.h>
23 
31 };
32 
34  int enable;
35  char *name;
36  void *value;
37  size_t value_len;
38 };
39 
40 extern const struct xattr_handler ocfs2_xattr_user_handler;
41 extern const struct xattr_handler ocfs2_xattr_trusted_handler;
45 extern const struct xattr_handler *ocfs2_xattr_handlers[];
46 
47 ssize_t ocfs2_listxattr(struct dentry *, char *, size_t);
48 int ocfs2_xattr_get_nolock(struct inode *, struct buffer_head *, int,
49  const char *, void *, size_t);
50 int ocfs2_xattr_set(struct inode *, int, const char *, const void *,
51  size_t, int);
52 int ocfs2_xattr_set_handle(handle_t *, struct inode *, struct buffer_head *,
53  int, const char *, const void *, size_t, int,
54  struct ocfs2_alloc_context *,
55  struct ocfs2_alloc_context *);
57  struct ocfs2_dinode *di);
58 int ocfs2_xattr_remove(struct inode *, struct buffer_head *);
59 int ocfs2_init_security_get(struct inode *, struct inode *,
60  const struct qstr *,
61  struct ocfs2_security_xattr_info *);
62 int ocfs2_init_security_set(handle_t *, struct inode *,
63  struct buffer_head *,
65  struct ocfs2_alloc_context *,
66  struct ocfs2_alloc_context *);
67 int ocfs2_calc_security_init(struct inode *,
69  int *, int *, struct ocfs2_alloc_context **);
70 int ocfs2_calc_xattr_init(struct inode *, struct buffer_head *,
72  int *, int *, int *);
73 
74 /*
75  * xattrs can live inside an inode, as part of an external xattr block,
76  * or inside an xattr bucket, which is the leaf of a tree rooted in an
77  * xattr block. Some of the xattr calls, especially the value setting
78  * functions, want to treat each of these locations as equal. Let's wrap
79  * them in a structure that we can pass around instead of raw buffer_heads.
80  */
82  struct buffer_head *vb_bh;
85 };
86 
88  struct buffer_head *fe_bh,
89  struct ocfs2_caching_info *ref_ci,
90  struct buffer_head *ref_root_bh,
91  struct ocfs2_cached_dealloc_ctxt *dealloc);
92 int ocfs2_reflink_xattrs(struct inode *old_inode,
93  struct buffer_head *old_bh,
94  struct inode *new_inode,
95  struct buffer_head *new_bh,
96  bool preserve_security);
97 int ocfs2_init_security_and_acl(struct inode *dir,
98  struct inode *inode,
99  const struct qstr *qstr);
100 #endif /* OCFS2_XATTR_H */