VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100  1) /* SPDX-License-Identifier: GPL-2.0 */
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  2) #ifndef _OMFS_H
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  3) #define _OMFS_H
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  4) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  5) #include <linux/module.h>
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  6) #include <linux/fs.h>
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  7) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  8) #include "omfs_fs.h"
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700  9) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 10) /* In-memory structures */
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 11) struct omfs_sb_info {
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 12) 	u64 s_num_blocks;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 13) 	u64 s_bitmap_ino;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 14) 	u64 s_root_ino;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 15) 	u32 s_blocksize;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 16) 	u32 s_mirrors;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 17) 	u32 s_sys_blocksize;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 18) 	u32 s_clustersize;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 19) 	int s_block_shift;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 20) 	unsigned long **s_imap;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 21) 	int s_imap_size;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 22) 	struct mutex s_bitmap_lock;
80fcbe751f01b (Eric W. Biederman  2012-02-07 16:29:49 -0800 23) 	kuid_t s_uid;
80fcbe751f01b (Eric W. Biederman  2012-02-07 16:29:49 -0800 24) 	kgid_t s_gid;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 25) 	int s_dmask;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 26) 	int s_fmask;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 27) };
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 28) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 29) /* convert a cluster number to a scaled block number */
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 30) static inline sector_t clus_to_blk(struct omfs_sb_info *sbi, sector_t block)
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 31) {
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 32) 	return block << sbi->s_block_shift;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 33) }
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 34) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 35) static inline struct omfs_sb_info *OMFS_SB(struct super_block *sb)
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 36) {
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 37) 	return sb->s_fs_info;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 38) }
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 39) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 40) /* bitmap.c */
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 41) extern unsigned long omfs_count_free(struct super_block *sb);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 42) extern int omfs_allocate_block(struct super_block *sb, u64 block);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 43) extern int omfs_allocate_range(struct super_block *sb, int min_request,
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 44) 			int max_request, u64 *return_block, int *return_size);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 45) extern int omfs_clear_range(struct super_block *sb, u64 block, int count);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 46) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 47) /* dir.c */
828c09509b969 (Alexey Dobriyan    2009-10-01 15:43:56 -0700 48) extern const struct file_operations omfs_dir_operations;
6e1d5dcc2bbbe (Alexey Dobriyan    2009-09-21 17:01:11 -0700 49) extern const struct inode_operations omfs_dir_inops;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 50) extern int omfs_make_empty(struct inode *inode, struct super_block *sb);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 51) extern int omfs_is_bad(struct omfs_sb_info *sbi, struct omfs_header *header,
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 52) 			u64 fsblock);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 53) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 54) /* file.c */
828c09509b969 (Alexey Dobriyan    2009-10-01 15:43:56 -0700 55) extern const struct file_operations omfs_file_operations;
6e1d5dcc2bbbe (Alexey Dobriyan    2009-09-21 17:01:11 -0700 56) extern const struct inode_operations omfs_file_inops;
7f09410bbc430 (Alexey Dobriyan    2009-09-21 17:01:10 -0700 57) extern const struct address_space_operations omfs_aops;
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 58) extern void omfs_make_empty_table(struct buffer_head *bh, int offset);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 59) extern int omfs_shrink_inode(struct inode *inode);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 60) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 61) /* inode.c */
f068272cb2f13 (Bob Copeland       2008-09-06 17:51:53 -0400 62) extern struct buffer_head *omfs_bread(struct super_block *sb, sector_t block);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 63) extern struct inode *omfs_iget(struct super_block *sb, ino_t inode);
587228be4a43c (Al Viro            2011-07-24 22:58:10 -0400 64) extern struct inode *omfs_new_inode(struct inode *dir, umode_t mode);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 65) extern int omfs_reserve_block(struct super_block *sb, sector_t block);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 66) extern int omfs_find_empty_block(struct super_block *sb, int mode, ino_t *ino);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 67) extern int omfs_sync_inode(struct inode *inode);
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 68) 
1b002d7b173ae (Bob Copeland       2008-07-25 19:45:15 -0700 69) #endif