Blame view
include/linux/reiserfs_xattr.h
4.52 KB
1da177e4c Linux-2.6.12-rc2 |
1 2 3 |
/* File: linux/reiserfs_xattr.h */ |
521dae191 [PATCH] cleanup i... |
4 5 6 7 |
#ifndef _LINUX_REISERFS_XATTR_H #define _LINUX_REISERFS_XATTR_H #include <linux/types.h> |
1da177e4c Linux-2.6.12-rc2 |
8 9 |
/* Magic value in header */ |
bd4c625c0 reiserfs: run scr... |
10 |
#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ |
1da177e4c Linux-2.6.12-rc2 |
11 12 |
struct reiserfs_xattr_header { |
bd4c625c0 reiserfs: run scr... |
13 14 |
__le32 h_magic; /* magic number for identification */ __le32 h_hash; /* hash of the value */ |
1da177e4c Linux-2.6.12-rc2 |
15 |
}; |
57fe60df6 reiserfs: add ato... |
16 17 18 19 20 |
struct reiserfs_security_handle { char *name; void *value; size_t length; }; |
1da177e4c Linux-2.6.12-rc2 |
21 |
#ifdef __KERNEL__ |
521dae191 [PATCH] cleanup i... |
22 |
|
98ca79d52 Don't include <li... |
23 |
#include <linux/init.h> |
521dae191 [PATCH] cleanup i... |
24 25 26 27 28 29 30 31 32 33 |
#include <linux/list.h> #include <linux/rwsem.h> #include <linux/reiserfs_fs_i.h> #include <linux/reiserfs_fs.h> struct inode; struct dentry; struct iattr; struct super_block; struct nameidata; |
1da177e4c Linux-2.6.12-rc2 |
34 |
|
a72bdb1cd reiserfs: Clean u... |
35 36 37 |
int reiserfs_xattr_register_handlers(void) __init; void reiserfs_xattr_unregister_handlers(void); int reiserfs_xattr_init(struct super_block *sb, int mount_flags); |
edcc37a04 Always lookup pri... |
38 |
int reiserfs_lookup_privroot(struct super_block *sb); |
a72bdb1cd reiserfs: Clean u... |
39 40 |
int reiserfs_delete_xattrs(struct inode *inode); int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); |
10556cb21 ->permission() sa... |
41 |
int reiserfs_permission(struct inode *inode, int mask); |
a72bdb1cd reiserfs: Clean u... |
42 |
|
1da177e4c Linux-2.6.12-rc2 |
43 |
#ifdef CONFIG_REISERFS_FS_XATTR |
1da177e4c Linux-2.6.12-rc2 |
44 |
#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) |
bd4c625c0 reiserfs: run scr... |
45 46 47 48 49 50 |
ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); int reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size); int reiserfs_removexattr(struct dentry *dentry, const char *name); |
bd4c625c0 reiserfs: run scr... |
51 |
|
48b32a355 reiserfs: use gen... |
52 |
int reiserfs_xattr_get(struct inode *, const char *, void *, size_t); |
bd4c625c0 reiserfs: run scr... |
53 |
int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int); |
0ab2621eb reiserfs: journal... |
54 55 56 |
int reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *, struct inode *, const char *, const void *, size_t, int); |
1da177e4c Linux-2.6.12-rc2 |
57 |
|
94d09a98c reiserfs: constif... |
58 59 60 |
extern const struct xattr_handler reiserfs_xattr_user_handler; extern const struct xattr_handler reiserfs_xattr_trusted_handler; extern const struct xattr_handler reiserfs_xattr_security_handler; |
57fe60df6 reiserfs: add ato... |
61 62 |
#ifdef CONFIG_REISERFS_FS_SECURITY int reiserfs_security_init(struct inode *dir, struct inode *inode, |
2a7dba391 fs/vfs/security: ... |
63 |
const struct qstr *qstr, |
57fe60df6 reiserfs: add ato... |
64 65 66 67 68 69 |
struct reiserfs_security_handle *sec); int reiserfs_security_write(struct reiserfs_transaction_handle *th, struct inode *inode, struct reiserfs_security_handle *sec); void reiserfs_security_free(struct reiserfs_security_handle *sec); #endif |
1da177e4c Linux-2.6.12-rc2 |
70 |
|
6cb4aff0a reiserfs: fix oop... |
71 72 73 74 |
static inline int reiserfs_xattrs_initialized(struct super_block *sb) { return REISERFS_SB(sb)->priv_root != NULL; } |
0ab2621eb reiserfs: journal... |
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
#define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size) { loff_t ret = 0; if (reiserfs_file_data_log(inode)) { ret = _ROUND_UP(xattr_size(size), inode->i_sb->s_blocksize); ret >>= inode->i_sb->s_blocksize_bits; } return ret; } /* We may have to create up to 3 objects: xattr root, xattr dir, xattr file. * Let's try to be smart about it. * xattr root: We cache it. If it's not cached, we may need to create it. * xattr dir: If anything has been loaded for this inode, we can set a flag * saying so. * xattr file: Since we don't cache xattrs, we can't tell. We always include * blocks for it. * * However, since root and dir can be created between calls - YOU MUST SAVE * THIS VALUE. */ static inline size_t reiserfs_xattr_jcreate_nblocks(struct inode *inode) { size_t nblocks = JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb); if ((REISERFS_I(inode)->i_flags & i_has_xattr_dir) == 0) { nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb); |
ab17c4f02 reiserfs: fixup x... |
103 |
if (!REISERFS_SB(inode->i_sb)->xattr_root->d_inode) |
0ab2621eb reiserfs: journal... |
104 105 106 107 108 |
nblocks += JOURNAL_BLOCKS_PER_OBJECT(inode->i_sb); } return nblocks; } |
068fbb315 [PATCH] reiserfs:... |
109 110 |
static inline void reiserfs_init_xattr_rwsem(struct inode *inode) { |
d984561b3 reiserfs: elimina... |
111 |
init_rwsem(&REISERFS_I(inode)->i_xattr_sem); |
068fbb315 [PATCH] reiserfs:... |
112 |
} |
1da177e4c Linux-2.6.12-rc2 |
113 |
#else |
1da177e4c Linux-2.6.12-rc2 |
114 115 116 117 |
#define reiserfs_getxattr NULL #define reiserfs_setxattr NULL #define reiserfs_listxattr NULL #define reiserfs_removexattr NULL |
1da177e4c Linux-2.6.12-rc2 |
118 |
|
068fbb315 [PATCH] reiserfs:... |
119 120 121 |
static inline void reiserfs_init_xattr_rwsem(struct inode *inode) { } |
521dae191 [PATCH] cleanup i... |
122 |
#endif /* CONFIG_REISERFS_FS_XATTR */ |
57fe60df6 reiserfs: add ato... |
123 124 125 |
#ifndef CONFIG_REISERFS_FS_SECURITY static inline int reiserfs_security_init(struct inode *dir, struct inode *inode, |
2a7dba391 fs/vfs/security: ... |
126 |
const struct qstr *qstr, |
57fe60df6 reiserfs: add ato... |
127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
struct reiserfs_security_handle *sec) { return 0; } static inline int reiserfs_security_write(struct reiserfs_transaction_handle *th, struct inode *inode, struct reiserfs_security_handle *sec) { return 0; } static inline void reiserfs_security_free(struct reiserfs_security_handle *sec) {} #endif |
521dae191 [PATCH] cleanup i... |
141 |
#endif /* __KERNEL__ */ |
1da177e4c Linux-2.6.12-rc2 |
142 |
|
521dae191 [PATCH] cleanup i... |
143 |
#endif /* _LINUX_REISERFS_XATTR_H */ |