diff options
author | Steffen Trumtrar <s.trumtrar@pengutronix.de> | 2020-02-05 10:12:01 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-02-10 09:42:43 +0100 |
commit | 831b3312e5fe902bacd699c9ff1e81e1c2b79f66 (patch) | |
tree | e619e2f21b4c130211c8ca25729fe37253b9ae43 /fs/jffs2/acl.h | |
parent | 15395b158eb9f4a2b2aeb7bde97d0d2db99badae (diff) | |
download | barebox-831b3312e5fe902bacd699c9ff1e81e1c2b79f66.tar.gz barebox-831b3312e5fe902bacd699c9ff1e81e1c2b79f66.tar.xz |
fs: jffs2: add initial support for reading jffs2
Import the jffs2 filesystem code from Linux v5.5-rc1 and convert it
to work with barebox.
Writing is *not* supported.
Testing was done with a n25q256a-compatible QuadSPI chip on a
SoCFPGA-based Socrates board.
Testing was done with a combination of:
user@somelinuxhost: mkfs.jffs2 --eraseblock=4 -d fs/jffs2/ -o jffs2.img
root@target:~ flash_erase -j /dev/mtd5 0 0
root@target:~ dd if=jffs2.img of=/dev/mtd5
barebox@EBV SOCrates:/ mount /dev/mtd0.data
(...)
mounted /dev/mtd0.data on /mnt/mtd0.data
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/jffs2/acl.h')
-rw-r--r-- | fs/jffs2/acl.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h new file mode 100644 index 0000000000..12d0271bdd --- /dev/null +++ b/fs/jffs2/acl.h @@ -0,0 +1,42 @@ +/* + * JFFS2 -- Journalling Flash File System, Version 2. + * + * Copyright © 2006 NEC Corporation + * + * Created by KaiGai Kohei <kaigai@ak.jp.nec.com> + * + * For licensing information, see the file 'LICENCE' in this directory. + * + */ + +struct jffs2_acl_entry { + jint16_t e_tag; + jint16_t e_perm; + jint32_t e_id; +}; + +struct jffs2_acl_entry_short { + jint16_t e_tag; + jint16_t e_perm; +}; + +struct jffs2_acl_header { + jint32_t a_version; + struct jffs2_acl_entry a_entries[]; +}; + +#ifdef CONFIG_JFFS2_FS_POSIX_ACL + +struct posix_acl *jffs2_get_acl(struct inode *inode, int type); +int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type); +extern int jffs2_init_acl_pre(struct inode *, struct inode *, umode_t *); +extern int jffs2_init_acl_post(struct inode *); + +#else + +#define jffs2_get_acl (NULL) +#define jffs2_set_acl (NULL) +#define jffs2_init_acl_pre(dir_i,inode,mode) (0) +#define jffs2_init_acl_post(inode) (0) + +#endif /* CONFIG_JFFS2_FS_POSIX_ACL */ |