Nishad Kamdar | d29fbcd | 2020-04-25 18:49:08 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Jaegeuk Kim | 0a8165d | 2012-11-29 13:28:09 +0900 | [diff] [blame] | 2 | /* |
Jaegeuk Kim | af48b85 | 2012-11-02 17:12:17 +0900 | [diff] [blame] | 3 | * fs/f2fs/acl.h |
| 4 | * |
| 5 | * Copyright (c) 2012 Samsung Electronics Co., Ltd. |
| 6 | * http://www.samsung.com/ |
| 7 | * |
| 8 | * Portions of this code from linux/fs/ext2/acl.h |
| 9 | * |
| 10 | * Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de> |
Jaegeuk Kim | af48b85 | 2012-11-02 17:12:17 +0900 | [diff] [blame] | 11 | */ |
| 12 | #ifndef __F2FS_ACL_H__ |
| 13 | #define __F2FS_ACL_H__ |
| 14 | |
| 15 | #include <linux/posix_acl_xattr.h> |
| 16 | |
| 17 | #define F2FS_ACL_VERSION 0x0001 |
| 18 | |
| 19 | struct f2fs_acl_entry { |
| 20 | __le16 e_tag; |
| 21 | __le16 e_perm; |
| 22 | __le32 e_id; |
| 23 | }; |
| 24 | |
| 25 | struct f2fs_acl_entry_short { |
| 26 | __le16 e_tag; |
| 27 | __le16 e_perm; |
| 28 | }; |
| 29 | |
| 30 | struct f2fs_acl_header { |
| 31 | __le32 a_version; |
| 32 | }; |
| 33 | |
| 34 | #ifdef CONFIG_F2FS_FS_POSIX_ACL |
| 35 | |
Jaegeuk Kim | b8b60e1 | 2013-10-28 13:12:09 +0900 | [diff] [blame] | 36 | extern struct posix_acl *f2fs_get_acl(struct inode *, int); |
Christian Brauner | 549c729 | 2021-01-21 14:19:43 +0100 | [diff] [blame] | 37 | extern int f2fs_set_acl(struct user_namespace *, struct inode *, |
| 38 | struct posix_acl *, int); |
Jaegeuk Kim | bce8d11 | 2014-10-13 19:42:53 -0700 | [diff] [blame] | 39 | extern int f2fs_init_acl(struct inode *, struct inode *, struct page *, |
| 40 | struct page *); |
Jaegeuk Kim | af48b85 | 2012-11-02 17:12:17 +0900 | [diff] [blame] | 41 | #else |
Jaegeuk Kim | af48b85 | 2012-11-02 17:12:17 +0900 | [diff] [blame] | 42 | #define f2fs_get_acl NULL |
| 43 | #define f2fs_set_acl NULL |
| 44 | |
Jaegeuk Kim | 2ed2d5b | 2013-10-28 13:17:54 +0900 | [diff] [blame] | 45 | static inline int f2fs_init_acl(struct inode *inode, struct inode *dir, |
Jaegeuk Kim | bce8d11 | 2014-10-13 19:42:53 -0700 | [diff] [blame] | 46 | struct page *ipage, struct page *dpage) |
Jaegeuk Kim | af48b85 | 2012-11-02 17:12:17 +0900 | [diff] [blame] | 47 | { |
| 48 | return 0; |
| 49 | } |
| 50 | #endif |
| 51 | #endif /* __F2FS_ACL_H__ */ |