1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/init.h>
3 #include <linux/posix_acl.h>
5 #define REISERFS_ACL_VERSION 0x0001
16 } reiserfs_acl_entry_short
;
20 } reiserfs_acl_header
;
22 static inline size_t reiserfs_acl_size(int count
)
25 return sizeof(reiserfs_acl_header
) +
26 count
* sizeof(reiserfs_acl_entry_short
);
28 return sizeof(reiserfs_acl_header
) +
29 4 * sizeof(reiserfs_acl_entry_short
) +
30 (count
- 4) * sizeof(reiserfs_acl_entry
);
34 static inline int reiserfs_acl_count(size_t size
)
37 size
-= sizeof(reiserfs_acl_header
);
38 s
= size
- 4 * sizeof(reiserfs_acl_entry_short
);
40 if (size
% sizeof(reiserfs_acl_entry_short
))
42 return size
/ sizeof(reiserfs_acl_entry_short
);
44 if (s
% sizeof(reiserfs_acl_entry
))
46 return s
/ sizeof(reiserfs_acl_entry
) + 4;
50 #ifdef CONFIG_REISERFS_FS_POSIX_ACL
51 struct posix_acl
*reiserfs_get_acl(struct inode
*inode
, int type
);
52 int reiserfs_set_acl(struct inode
*inode
, struct posix_acl
*acl
, int type
);
53 int reiserfs_acl_chmod(struct inode
*inode
);
54 int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle
*th
,
55 struct inode
*dir
, struct dentry
*dentry
,
57 int reiserfs_cache_default_acl(struct inode
*dir
);
61 #define reiserfs_cache_default_acl(inode) 0
62 #define reiserfs_get_acl NULL
63 #define reiserfs_set_acl NULL
65 static inline int reiserfs_acl_chmod(struct inode
*inode
)
71 reiserfs_inherit_default_acl(struct reiserfs_transaction_handle
*th
,
72 const struct inode
*dir
, struct dentry
*dentry
,