7336d0e654f7a fs/gfs2/xattr.h (Thomas Gleixner 2019-05-31 01:09:56 -0700 1) /* SPDX-License-Identifier: GPL-2.0-only */
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 2) /*
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 3) * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3a8a9a1034813 fs/gfs2/eattr.h (Steven Whitehouse 2006-05-18 15:09:15 -0400 4) * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 5) */
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 6)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 7) #ifndef __EATTR_DOT_H__
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 8) #define __EATTR_DOT_H__
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 9)
f2f7ba5237e2f fs/gfs2/eattr.h (Steven Whitehouse 2006-09-05 10:39:21 -0400 10) struct gfs2_inode;
f2f7ba5237e2f fs/gfs2/eattr.h (Steven Whitehouse 2006-09-05 10:39:21 -0400 11) struct iattr;
f2f7ba5237e2f fs/gfs2/eattr.h (Steven Whitehouse 2006-09-05 10:39:21 -0400 12)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 13) #define GFS2_EA_REC_LEN(ea) be32_to_cpu((ea)->ea_rec_len)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 14) #define GFS2_EA_DATA_LEN(ea) be32_to_cpu((ea)->ea_data_len)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 15)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 16) #define GFS2_EA_SIZE(ea) \
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 17) ALIGN(sizeof(struct gfs2_ea_header) + (ea)->ea_name_len + \
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 18) ((GFS2_EA_IS_STUFFED(ea)) ? GFS2_EA_DATA_LEN(ea) : \
86d006365610f fs/gfs2/xattr.h (Steven Whitehouse 2009-09-14 09:50:57 +0100 19) (sizeof(__be64) * (ea)->ea_num_ptrs)), 8)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 20)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 21) #define GFS2_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 22) #define GFS2_EA_IS_LAST(ea) ((ea)->ea_flags & GFS2_EAFLAG_LAST)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 23)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 24) #define GFS2_EAREQ_SIZE_STUFFED(er) \
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 25) ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + (er)->er_data_len, 8)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 26)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 27) #define GFS2_EA2NAME(ea) ((char *)((struct gfs2_ea_header *)(ea) + 1))
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 28) #define GFS2_EA2DATA(ea) (GFS2_EA2NAME(ea) + (ea)->ea_name_len)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 29)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 30) #define GFS2_EA2DATAPTRS(ea) \
b44b84d765b02 fs/gfs2/eattr.h (Al Viro 2006-10-14 10:46:30 -0400 31) ((__be64 *)(GFS2_EA2NAME(ea) + ALIGN((ea)->ea_name_len, 8)))
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 32)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 33) #define GFS2_EA2NEXT(ea) \
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 34) ((struct gfs2_ea_header *)((char *)(ea) + GFS2_EA_REC_LEN(ea)))
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 35)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 36) #define GFS2_EA_BH2FIRST(bh) \
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 37) ((struct gfs2_ea_header *)((bh)->b_data + sizeof(struct gfs2_meta_header)))
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 38)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 39) struct gfs2_ea_request {
cca195c5c09b8 fs/gfs2/eattr.h (Steven Whitehouse 2006-09-05 13:15:18 -0400 40) const char *er_name;
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 41) char *er_data;
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 42) unsigned int er_name_len;
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 43) unsigned int er_data_len;
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 44) unsigned int er_type; /* GFS2_EATYPE_... */
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 45) };
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 46)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 47) struct gfs2_ea_location {
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 48) struct buffer_head *el_bh;
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 49) struct gfs2_ea_header *el_ea;
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 50) struct gfs2_ea_header *el_prev;
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 51) };
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 52)
431547b3c4533 fs/gfs2/xattr.h (Christoph Hellwig 2009-11-13 09:52:56 +0000 53) extern int __gfs2_xattr_set(struct inode *inode, const char *name,
431547b3c4533 fs/gfs2/xattr.h (Christoph Hellwig 2009-11-13 09:52:56 +0000 54) const void *value, size_t size,
431547b3c4533 fs/gfs2/xattr.h (Christoph Hellwig 2009-11-13 09:52:56 +0000 55) int flags, int type);
40b78a322365a fs/gfs2/eattr.h (Steven Whitehouse 2009-08-26 18:41:32 +0100 56) extern ssize_t gfs2_listxattr(struct dentry *dentry, char *buffer, size_t size);
40b78a322365a fs/gfs2/eattr.h (Steven Whitehouse 2009-08-26 18:41:32 +0100 57) extern int gfs2_ea_dealloc(struct gfs2_inode *ip);
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 58)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 59) /* Exported to acl.c */
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 60)
479c427dd60fe fs/gfs2/xattr.h (Steven Whitehouse 2009-10-02 12:00:00 +0100 61) extern int gfs2_xattr_acl_get(struct gfs2_inode *ip, const char *name, char **data);
639b6d79b8c20 fs/gfs2/eattr.h (Ryan O'Hara 2006-05-22 10:08:35 -0400 62)
b3b94faa5fe59 fs/gfs2/eattr.h (David Teigland 2006-01-16 16:50:04 +0000 63) #endif /* __EATTR_DOT_H__ */