Blame view
fs/gfs2/xattr.h
2.13 KB
b3b94faa5 [GFS2] The core o... |
1 2 |
/* * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
3a8a9a103 [GFS2] Update cop... |
3 |
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. |
b3b94faa5 [GFS2] The core o... |
4 5 6 |
* * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions |
e9fc2aa09 [GFS2] Update cop... |
7 |
* of the GNU General Public License version 2. |
b3b94faa5 [GFS2] The core o... |
8 9 10 11 |
*/ #ifndef __EATTR_DOT_H__ #define __EATTR_DOT_H__ |
f2f7ba523 [GFS2] Make heade... |
12 13 |
struct gfs2_inode; struct iattr; |
b3b94faa5 [GFS2] The core o... |
14 15 16 17 18 19 |
#define GFS2_EA_REC_LEN(ea) be32_to_cpu((ea)->ea_rec_len) #define GFS2_EA_DATA_LEN(ea) be32_to_cpu((ea)->ea_data_len) #define GFS2_EA_SIZE(ea) \ ALIGN(sizeof(struct gfs2_ea_header) + (ea)->ea_name_len + \ ((GFS2_EA_IS_STUFFED(ea)) ? GFS2_EA_DATA_LEN(ea) : \ |
86d006365 GFS2: Whitespace ... |
20 |
(sizeof(__be64) * (ea)->ea_num_ptrs)), 8) |
b3b94faa5 [GFS2] The core o... |
21 |
|
b3b94faa5 [GFS2] The core o... |
22 23 24 25 26 |
#define GFS2_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs) #define GFS2_EA_IS_LAST(ea) ((ea)->ea_flags & GFS2_EAFLAG_LAST) #define GFS2_EAREQ_SIZE_STUFFED(er) \ ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + (er)->er_data_len, 8) |
b3b94faa5 [GFS2] The core o... |
27 28 29 30 |
#define GFS2_EA2NAME(ea) ((char *)((struct gfs2_ea_header *)(ea) + 1)) #define GFS2_EA2DATA(ea) (GFS2_EA2NAME(ea) + (ea)->ea_name_len) #define GFS2_EA2DATAPTRS(ea) \ |
b44b84d76 [GFS2] gfs2 misc ... |
31 |
((__be64 *)(GFS2_EA2NAME(ea) + ALIGN((ea)->ea_name_len, 8))) |
b3b94faa5 [GFS2] The core o... |
32 33 34 35 36 37 |
#define GFS2_EA2NEXT(ea) \ ((struct gfs2_ea_header *)((char *)(ea) + GFS2_EA_REC_LEN(ea))) #define GFS2_EA_BH2FIRST(bh) \ ((struct gfs2_ea_header *)((bh)->b_data + sizeof(struct gfs2_meta_header))) |
b3b94faa5 [GFS2] The core o... |
38 |
struct gfs2_ea_request { |
cca195c5c [GFS2] Extended a... |
39 |
const char *er_name; |
b3b94faa5 [GFS2] The core o... |
40 41 42 43 |
char *er_data; unsigned int er_name_len; unsigned int er_data_len; unsigned int er_type; /* GFS2_EATYPE_... */ |
b3b94faa5 [GFS2] The core o... |
44 45 46 47 48 49 50 |
}; struct gfs2_ea_location { struct buffer_head *el_bh; struct gfs2_ea_header *el_ea; struct gfs2_ea_header *el_prev; }; |
431547b3c sanitize xattr ha... |
51 52 53 |
extern int __gfs2_xattr_set(struct inode *inode, const char *name, const void *value, size_t size, int flags, int type); |
40b78a322 GFS2: Clean up of... |
54 55 |
extern ssize_t gfs2_listxattr(struct dentry *dentry, char *buffer, size_t size); extern int gfs2_ea_dealloc(struct gfs2_inode *ip); |
b3b94faa5 [GFS2] The core o... |
56 |
|
b3b94faa5 [GFS2] The core o... |
57 |
/* Exported to acl.c */ |
479c427dd GFS2: Clean up ACLs |
58 59 |
extern int gfs2_xattr_acl_get(struct gfs2_inode *ip, const char *name, char **data); extern int gfs2_xattr_acl_chmod(struct gfs2_inode *ip, struct iattr *attr, char *data); |
639b6d79b [GFS2] selinux su... |
60 |
|
b3b94faa5 [GFS2] The core o... |
61 |
#endif /* __EATTR_DOT_H__ */ |