Go to the documentation of this file.
10 #ifndef __EATTR_DOT_H__
11 #define __EATTR_DOT_H__
16 #define GFS2_EA_REC_LEN(ea) be32_to_cpu((ea)->ea_rec_len)
17 #define GFS2_EA_DATA_LEN(ea) be32_to_cpu((ea)->ea_data_len)
19 #define GFS2_EA_SIZE(ea) \
20 ALIGN(sizeof(struct gfs2_ea_header) + (ea)->ea_name_len + \
21 ((GFS2_EA_IS_STUFFED(ea)) ? GFS2_EA_DATA_LEN(ea) : \
22 (sizeof(__be64) * (ea)->ea_num_ptrs)), 8)
24 #define GFS2_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs)
25 #define GFS2_EA_IS_LAST(ea) ((ea)->ea_flags & GFS2_EAFLAG_LAST)
27 #define GFS2_EAREQ_SIZE_STUFFED(er) \
28 ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + (er)->er_data_len, 8)
30 #define GFS2_EA2NAME(ea) ((char *)((struct gfs2_ea_header *)(ea) + 1))
31 #define GFS2_EA2DATA(ea) (GFS2_EA2NAME(ea) + (ea)->ea_name_len)
33 #define GFS2_EA2DATAPTRS(ea) \
34 ((__be64 *)(GFS2_EA2NAME(ea) + ALIGN((ea)->ea_name_len, 8)))
36 #define GFS2_EA2NEXT(ea) \
37 ((struct gfs2_ea_header *)((char *)(ea) + GFS2_EA_REC_LEN(ea)))
39 #define GFS2_EA_BH2FIRST(bh) \
40 ((struct gfs2_ea_header *)((bh)->b_data + sizeof(struct gfs2_meta_header)))