Blame view

fs/ocfs2/xattr.h 3.57 KB
cf1d6c763   Tiger Yang   ocfs2: Add extend...
1
2
3
4
5
  /* -*- mode: c; c-basic-offset: 8; -*-
   * vim: noexpandtab sw=8 ts=8 sts=0:
   *
   * xattr.h
   *
c3cb68273   Tiger Yang   ocfs2: fix licens...
6
   * Copyright (C) 2004, 2008 Oracle.  All rights reserved.
cf1d6c763   Tiger Yang   ocfs2: Add extend...
7
8
9
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public
c3cb68273   Tiger Yang   ocfs2: fix licens...
10
   * License version 2 as published by the Free Software Foundation.
cf1d6c763   Tiger Yang   ocfs2: Add extend...
11
12
13
14
15
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * General Public License for more details.
cf1d6c763   Tiger Yang   ocfs2: Add extend...
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   */
  
  #ifndef OCFS2_XATTR_H
  #define OCFS2_XATTR_H
  
  #include <linux/init.h>
  #include <linux/xattr.h>
  
  enum ocfs2_xattr_type {
  	OCFS2_XATTR_INDEX_USER = 1,
  	OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS,
  	OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT,
  	OCFS2_XATTR_INDEX_TRUSTED,
  	OCFS2_XATTR_INDEX_SECURITY,
  	OCFS2_XATTR_MAX
  };
534eadddc   Tiger Yang   ocfs2: add ocfs2_...
32
33
34
35
36
37
  struct ocfs2_security_xattr_info {
  	int enable;
  	char *name;
  	void *value;
  	size_t value_len;
  };
537d81ca7   Stephen Hemminger   ocfs: constify xa...
38
39
40
41
42
43
  extern const struct xattr_handler ocfs2_xattr_user_handler;
  extern const struct xattr_handler ocfs2_xattr_trusted_handler;
  extern const struct xattr_handler ocfs2_xattr_security_handler;
  extern const struct xattr_handler ocfs2_xattr_acl_access_handler;
  extern const struct xattr_handler ocfs2_xattr_acl_default_handler;
  extern const struct xattr_handler *ocfs2_xattr_handlers[];
cf1d6c763   Tiger Yang   ocfs2: Add extend...
44

0030e0015   Tiger Yang   ocfs2: fix functi...
45
  ssize_t ocfs2_listxattr(struct dentry *, char *, size_t);
4e3e9d027   Tiger Yang   ocfs2: add ocfs2_...
46
47
  int ocfs2_xattr_get_nolock(struct inode *, struct buffer_head *, int,
  			   const char *, void *, size_t);
0030e0015   Tiger Yang   ocfs2: fix functi...
48
49
  int ocfs2_xattr_set(struct inode *, int, const char *, const void *,
  		    size_t, int);
6c3faba44   Tiger Yang   ocfs2: add ocfs2_...
50
51
52
53
  int ocfs2_xattr_set_handle(handle_t *, struct inode *, struct buffer_head *,
  			   int, const char *, const void *, size_t, int,
  			   struct ocfs2_alloc_context *,
  			   struct ocfs2_alloc_context *);
8b2c0dba5   Tao Ma   ocfs2: Call refco...
54
55
  int ocfs2_has_inline_xattr_value_outside(struct inode *inode,
  					 struct ocfs2_dinode *di);
0030e0015   Tiger Yang   ocfs2: fix functi...
56
  int ocfs2_xattr_remove(struct inode *, struct buffer_head *);
534eadddc   Tiger Yang   ocfs2: add ocfs2_...
57
  int ocfs2_init_security_get(struct inode *, struct inode *,
2a7dba391   Eric Paris   fs/vfs/security: ...
58
  			    const struct qstr *,
534eadddc   Tiger Yang   ocfs2: add ocfs2_...
59
60
61
62
63
64
65
66
67
  			    struct ocfs2_security_xattr_info *);
  int ocfs2_init_security_set(handle_t *, struct inode *,
  			    struct buffer_head *,
  			    struct ocfs2_security_xattr_info *,
  			    struct ocfs2_alloc_context *,
  			    struct ocfs2_alloc_context *);
  int ocfs2_calc_security_init(struct inode *,
  			     struct ocfs2_security_xattr_info *,
  			     int *, int *, struct ocfs2_alloc_context **);
89c38bd0a   Tiger Yang   ocfs2: add ocfs2_...
68
  int ocfs2_calc_xattr_init(struct inode *, struct buffer_head *,
67697cbdc   Al Viro   ocfs2: propagate ...
69
  			  umode_t, struct ocfs2_security_xattr_info *,
9b7895efa   Mark Fasheh   ocfs2: Add a name...
70
  			  int *, int *, int *);
012255961   Tao Ma   ocfs2: Enable xat...
71

2a50a743b   Joel Becker   ocfs2: Create ocf...
72
73
74
75
76
77
78
79
80
81
82
83
  /*
   * xattrs can live inside an inode, as part of an external xattr block,
   * or inside an xattr bucket, which is the leaf of a tree rooted in an
   * xattr block.  Some of the xattr calls, especially the value setting
   * functions, want to treat each of these locations as equal.  Let's wrap
   * them in a structure that we can pass around instead of raw buffer_heads.
   */
  struct ocfs2_xattr_value_buf {
  	struct buffer_head		*vb_bh;
  	ocfs2_journal_access_func	vb_access;
  	struct ocfs2_xattr_value_root	*vb_xv;
  };
0129241e2   Tao Ma   ocfs2: Attach xat...
84
85
86
87
88
  int ocfs2_xattr_attach_refcount_tree(struct inode *inode,
  				     struct buffer_head *fe_bh,
  				     struct ocfs2_caching_info *ref_ci,
  				     struct buffer_head *ref_root_bh,
  				     struct ocfs2_cached_dealloc_ctxt *dealloc);
2999d12f4   Tao Ma   ocfs2: Add reflin...
89
90
91
  int ocfs2_reflink_xattrs(struct inode *old_inode,
  			 struct buffer_head *old_bh,
  			 struct inode *new_inode,
0fe9b66c6   Tao Ma   ocfs2: Add preser...
92
93
94
  			 struct buffer_head *new_bh,
  			 bool preserve_security);
  int ocfs2_init_security_and_acl(struct inode *dir,
2a7dba391   Eric Paris   fs/vfs/security: ...
95
96
  				struct inode *inode,
  				const struct qstr *qstr);
cf1d6c763   Tiger Yang   ocfs2: Add extend...
97
  #endif /* OCFS2_XATTR_H */