Linux Audio

Check our new training course

Linux BSP development engineering services

Need help to port Linux and bootloaders to your hardware?
Loading...
v4.6
 
  1/*
  2 * QNX6 file system, Linux implementation.
  3 *
  4 * Version : 1.0.0
  5 *
  6 * History :
  7 *
  8 * 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
  9 * 16-02-2012 page map extension by Al Viro
 10 *
 11 */
 12
 13#ifdef pr_fmt
 14#undef pr_fmt
 15#endif
 16
 17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 18
 19#include <linux/fs.h>
 20#include <linux/pagemap.h>
 21
 22typedef __u16 __bitwise __fs16;
 23typedef __u32 __bitwise __fs32;
 24typedef __u64 __bitwise __fs64;
 25
 26#include <linux/qnx6_fs.h>
 27
 28struct qnx6_sb_info {
 29	struct buffer_head	*sb_buf;	/* superblock buffer */
 30	struct qnx6_super_block	*sb;		/* our superblock */
 31	int			s_blks_off;	/* blkoffset fs-startpoint */
 32	int			s_ptrbits;	/* indirect pointer bitfield */
 33	unsigned long		s_mount_opt;	/* all mount options */
 34	int			s_bytesex;	/* holds endianess info */
 35	struct inode *		inodes;
 36	struct inode *		longfile;
 37};
 38
 39struct qnx6_inode_info {
 40	__fs32			di_block_ptr[QNX6_NO_DIRECT_POINTERS];
 41	__u8			di_filelevels;
 42	__u32			i_dir_start_lookup;
 43	struct inode		vfs_inode;
 44};
 45
 46extern struct inode *qnx6_iget(struct super_block *sb, unsigned ino);
 47extern struct dentry *qnx6_lookup(struct inode *dir, struct dentry *dentry,
 48					unsigned int flags);
 49
 50#ifdef CONFIG_QNX6FS_DEBUG
 51extern void qnx6_superblock_debug(struct qnx6_super_block *,
 52						struct super_block *);
 53#endif
 54
 55extern const struct inode_operations qnx6_dir_inode_operations;
 56extern const struct file_operations qnx6_dir_operations;
 57
 58static inline struct qnx6_sb_info *QNX6_SB(struct super_block *sb)
 59{
 60	return sb->s_fs_info;
 61}
 62
 63static inline struct qnx6_inode_info *QNX6_I(struct inode *inode)
 64{
 65	return container_of(inode, struct qnx6_inode_info, vfs_inode);
 66}
 67
 68#define clear_opt(o, opt)		(o &= ~(QNX6_MOUNT_##opt))
 69#define set_opt(o, opt)			(o |= (QNX6_MOUNT_##opt))
 70#define test_opt(sb, opt)		(QNX6_SB(sb)->s_mount_opt & \
 71					 QNX6_MOUNT_##opt)
 72enum {
 73	BYTESEX_LE,
 74	BYTESEX_BE,
 75};
 76
 77static inline __u64 fs64_to_cpu(struct qnx6_sb_info *sbi, __fs64 n)
 78{
 79	if (sbi->s_bytesex == BYTESEX_LE)
 80		return le64_to_cpu((__force __le64)n);
 81	else
 82		return be64_to_cpu((__force __be64)n);
 83}
 84
 85static inline __fs64 cpu_to_fs64(struct qnx6_sb_info *sbi, __u64 n)
 86{
 87	if (sbi->s_bytesex == BYTESEX_LE)
 88		return (__force __fs64)cpu_to_le64(n);
 89	else
 90		return (__force __fs64)cpu_to_be64(n);
 91}
 92
 93static inline __u32 fs32_to_cpu(struct qnx6_sb_info *sbi, __fs32 n)
 94{
 95	if (sbi->s_bytesex == BYTESEX_LE)
 96		return le32_to_cpu((__force __le32)n);
 97	else
 98		return be32_to_cpu((__force __be32)n);
 99}
100
101static inline __fs32 cpu_to_fs32(struct qnx6_sb_info *sbi, __u32 n)
102{
103	if (sbi->s_bytesex == BYTESEX_LE)
104		return (__force __fs32)cpu_to_le32(n);
105	else
106		return (__force __fs32)cpu_to_be32(n);
107}
108
109static inline __u16 fs16_to_cpu(struct qnx6_sb_info *sbi, __fs16 n)
110{
111	if (sbi->s_bytesex == BYTESEX_LE)
112		return le16_to_cpu((__force __le16)n);
113	else
114		return be16_to_cpu((__force __be16)n);
115}
116
117static inline __fs16 cpu_to_fs16(struct qnx6_sb_info *sbi, __u16 n)
118{
119	if (sbi->s_bytesex == BYTESEX_LE)
120		return (__force __fs16)cpu_to_le16(n);
121	else
122		return (__force __fs16)cpu_to_be16(n);
123}
124
125extern struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s,
126						    int silent);
127
128static inline void qnx6_put_page(struct page *page)
129{
130	kunmap(page);
131	put_page(page);
132}
133
134extern unsigned qnx6_find_entry(int len, struct inode *dir, const char *name,
135				struct page **res_page);
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 * QNX6 file system, Linux implementation.
  4 *
  5 * Version : 1.0.0
  6 *
  7 * History :
  8 *
  9 * 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
 10 * 16-02-2012 page map extension by Al Viro
 11 *
 12 */
 13
 14#ifdef pr_fmt
 15#undef pr_fmt
 16#endif
 17
 18#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 19
 20#include <linux/fs.h>
 21#include <linux/pagemap.h>
 22
 23typedef __u16 __bitwise __fs16;
 24typedef __u32 __bitwise __fs32;
 25typedef __u64 __bitwise __fs64;
 26
 27#include <linux/qnx6_fs.h>
 28
 29struct qnx6_sb_info {
 30	struct buffer_head	*sb_buf;	/* superblock buffer */
 31	struct qnx6_super_block	*sb;		/* our superblock */
 32	int			s_blks_off;	/* blkoffset fs-startpoint */
 33	int			s_ptrbits;	/* indirect pointer bitfield */
 34	unsigned long		s_mount_opt;	/* all mount options */
 35	int			s_bytesex;	/* holds endianess info */
 36	struct inode *		inodes;
 37	struct inode *		longfile;
 38};
 39
 40struct qnx6_inode_info {
 41	__fs32			di_block_ptr[QNX6_NO_DIRECT_POINTERS];
 42	__u8			di_filelevels;
 43	__u32			i_dir_start_lookup;
 44	struct inode		vfs_inode;
 45};
 46
 47extern struct inode *qnx6_iget(struct super_block *sb, unsigned ino);
 48extern struct dentry *qnx6_lookup(struct inode *dir, struct dentry *dentry,
 49					unsigned int flags);
 50
 51#ifdef CONFIG_QNX6FS_DEBUG
 52extern void qnx6_superblock_debug(struct qnx6_super_block *,
 53						struct super_block *);
 54#endif
 55
 56extern const struct inode_operations qnx6_dir_inode_operations;
 57extern const struct file_operations qnx6_dir_operations;
 58
 59static inline struct qnx6_sb_info *QNX6_SB(struct super_block *sb)
 60{
 61	return sb->s_fs_info;
 62}
 63
 64static inline struct qnx6_inode_info *QNX6_I(struct inode *inode)
 65{
 66	return container_of(inode, struct qnx6_inode_info, vfs_inode);
 67}
 68
 69#define clear_opt(o, opt)		(o &= ~(QNX6_MOUNT_##opt))
 70#define set_opt(o, opt)			(o |= (QNX6_MOUNT_##opt))
 71#define test_opt(sb, opt)		(QNX6_SB(sb)->s_mount_opt & \
 72					 QNX6_MOUNT_##opt)
 73enum {
 74	BYTESEX_LE,
 75	BYTESEX_BE,
 76};
 77
 78static inline __u64 fs64_to_cpu(struct qnx6_sb_info *sbi, __fs64 n)
 79{
 80	if (sbi->s_bytesex == BYTESEX_LE)
 81		return le64_to_cpu((__force __le64)n);
 82	else
 83		return be64_to_cpu((__force __be64)n);
 84}
 85
 86static inline __fs64 cpu_to_fs64(struct qnx6_sb_info *sbi, __u64 n)
 87{
 88	if (sbi->s_bytesex == BYTESEX_LE)
 89		return (__force __fs64)cpu_to_le64(n);
 90	else
 91		return (__force __fs64)cpu_to_be64(n);
 92}
 93
 94static inline __u32 fs32_to_cpu(struct qnx6_sb_info *sbi, __fs32 n)
 95{
 96	if (sbi->s_bytesex == BYTESEX_LE)
 97		return le32_to_cpu((__force __le32)n);
 98	else
 99		return be32_to_cpu((__force __be32)n);
100}
101
102static inline __fs32 cpu_to_fs32(struct qnx6_sb_info *sbi, __u32 n)
103{
104	if (sbi->s_bytesex == BYTESEX_LE)
105		return (__force __fs32)cpu_to_le32(n);
106	else
107		return (__force __fs32)cpu_to_be32(n);
108}
109
110static inline __u16 fs16_to_cpu(struct qnx6_sb_info *sbi, __fs16 n)
111{
112	if (sbi->s_bytesex == BYTESEX_LE)
113		return le16_to_cpu((__force __le16)n);
114	else
115		return be16_to_cpu((__force __be16)n);
116}
117
118static inline __fs16 cpu_to_fs16(struct qnx6_sb_info *sbi, __u16 n)
119{
120	if (sbi->s_bytesex == BYTESEX_LE)
121		return (__force __fs16)cpu_to_le16(n);
122	else
123		return (__force __fs16)cpu_to_be16(n);
124}
125
126extern struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s,
127						    int silent);
128
129unsigned qnx6_find_ino(int len, struct inode *dir, const char *name);