linux/fs/affs/affs.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifdef pr_fmt
#undef pr_fmt
#endif

#define pr_fmt(fmt)

#include <linux/types.h>
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include "amigaffs.h"
#include <linux/mutex.h>
#include <linux/workqueue.h>

/* Ugly macros make the code more pretty. */

#define GET_END_PTR(st,p,sz)
#define AFFS_GET_HASHENTRY(data,hashkey)
#define AFFS_BLOCK(sb, bh, blk)

#define AFFS_HEAD(bh)
#define AFFS_TAIL(sb, bh)
#define AFFS_ROOT_HEAD(bh)
#define AFFS_ROOT_TAIL(sb, bh)
#define AFFS_DATA_HEAD(bh)
#define AFFS_DATA(bh)

#define AFFS_CACHE_SIZE

#define AFFS_LC_SIZE
#define AFFS_AC_SIZE
#define AFFS_AC_MASK

#define AFFSNAMEMAX

struct affs_ext_key {};

/*
 * affs fs inode data in memory
 */
struct affs_inode_info {};

/* short cut to get to the affs specific inode data */
static inline struct affs_inode_info *AFFS_I(struct inode *inode)
{}

/*
 * super-block data in memory
 *
 * Block numbers are adjusted for their actual size
 *
 */

struct affs_bm_info {};

struct affs_sb_info {};

#define AFFS_MOUNT_SF_INTL
#define AFFS_MOUNT_SF_BM_VALID
#define AFFS_MOUNT_SF_IMMUTABLE
#define AFFS_MOUNT_SF_QUIET
#define AFFS_MOUNT_SF_SETUID
#define AFFS_MOUNT_SF_SETGID
#define AFFS_MOUNT_SF_SETMODE
#define AFFS_MOUNT_SF_MUFS
#define AFFS_MOUNT_SF_OFS
#define AFFS_MOUNT_SF_PREFIX
#define AFFS_MOUNT_SF_VERBOSE
#define AFFS_MOUNT_SF_NO_TRUNCATE

#define affs_clear_opt(o, opt)
#define affs_set_opt(o, opt)
#define affs_test_opt(o, opt)

/* short cut to get to the affs specific sb data */
static inline struct affs_sb_info *AFFS_SB(struct super_block *sb)
{}

void affs_mark_sb_dirty(struct super_block *sb);

/* amigaffs.c */

extern int	affs_insert_hash(struct inode *inode, struct buffer_head *bh);
extern int	affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh);
extern int	affs_remove_header(struct dentry *dentry);
extern u32	affs_checksum_block(struct super_block *sb, struct buffer_head *bh);
extern void	affs_fix_checksum(struct super_block *sb, struct buffer_head *bh);
extern void	affs_secs_to_datestamp(time64_t secs, struct affs_date *ds);
extern umode_t	affs_prot_to_mode(u32 prot);
extern void	affs_mode_to_prot(struct inode *inode);
__printf(3, 4)
extern void	affs_error(struct super_block *sb, const char *function,
			   const char *fmt, ...);
__printf(3, 4)
extern void	affs_warning(struct super_block *sb, const char *function,
			     const char *fmt, ...);
extern bool	affs_nofilenametruncate(const struct dentry *dentry);
extern int	affs_check_name(const unsigned char *name, int len,
				bool notruncate);
extern int	affs_copy_name(unsigned char *bstr, struct dentry *dentry);

/* bitmap. c */

extern u32	affs_count_free_blocks(struct super_block *s);
extern void	affs_free_block(struct super_block *sb, u32 block);
extern u32	affs_alloc_block(struct inode *inode, u32 goal);
extern int	affs_init_bitmap(struct super_block *sb, int *flags);
extern void	affs_free_bitmap(struct super_block *sb);

/* namei.c */

extern const struct export_operations affs_export_ops;
extern int	affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int);
extern int	affs_unlink(struct inode *dir, struct dentry *dentry);
extern int	affs_create(struct mnt_idmap *idmap, struct inode *dir,
			struct dentry *dentry, umode_t mode, bool);
extern int	affs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
			struct dentry *dentry, umode_t mode);
extern int	affs_rmdir(struct inode *dir, struct dentry *dentry);
extern int	affs_link(struct dentry *olddentry, struct inode *dir,
			  struct dentry *dentry);
extern int	affs_symlink(struct mnt_idmap *idmap,
			struct inode *dir, struct dentry *dentry,
			const char *symname);
extern int	affs_rename2(struct mnt_idmap *idmap,
			struct inode *old_dir, struct dentry *old_dentry,
			struct inode *new_dir, struct dentry *new_dentry,
			unsigned int flags);

/* inode.c */

extern struct inode		*affs_new_inode(struct inode *dir);
extern int			 affs_notify_change(struct mnt_idmap *idmap,
					struct dentry *dentry, struct iattr *attr);
extern void			 affs_evict_inode(struct inode *inode);
extern struct inode		*affs_iget(struct super_block *sb,
					unsigned long ino);
extern int			 affs_write_inode(struct inode *inode,
					struct writeback_control *wbc);
extern int			 affs_add_entry(struct inode *dir, struct inode *inode,
					struct dentry *dentry, s32 type);

/* file.c */

void		affs_free_prealloc(struct inode *inode);
extern void	affs_truncate(struct inode *);
int		affs_file_fsync(struct file *, loff_t, loff_t, int);

/* dir.c */

extern void   affs_dir_truncate(struct inode *);

/* jump tables */

extern const struct inode_operations	 affs_file_inode_operations;
extern const struct inode_operations	 affs_dir_inode_operations;
extern const struct inode_operations   affs_symlink_inode_operations;
extern const struct file_operations	 affs_file_operations;
extern const struct file_operations	 affs_file_operations_ofs;
extern const struct file_operations	 affs_dir_operations;
extern const struct address_space_operations	 affs_symlink_aops;
extern const struct address_space_operations	 affs_aops;
extern const struct address_space_operations	 affs_aops_ofs;

extern const struct dentry_operations	 affs_dentry_operations;
extern const struct dentry_operations	 affs_intl_dentry_operations;

static inline bool affs_validblock(struct super_block *sb, int block)
{}

static inline void
affs_set_blocksize(struct super_block *sb, int size)
{}
static inline struct buffer_head *
affs_bread(struct super_block *sb, int block)
{}
static inline struct buffer_head *
affs_getblk(struct super_block *sb, int block)
{}
static inline struct buffer_head *
affs_getzeroblk(struct super_block *sb, int block)
{}
static inline struct buffer_head *
affs_getemptyblk(struct super_block *sb, int block)
{}
static inline void
affs_brelse(struct buffer_head *bh)
{}

static inline void
affs_adjust_checksum(struct buffer_head *bh, u32 val)
{}
static inline void
affs_adjust_bitmapchecksum(struct buffer_head *bh, u32 val)
{}

static inline void
affs_lock_link(struct inode *inode)
{}
static inline void
affs_unlock_link(struct inode *inode)
{}
static inline void
affs_lock_dir(struct inode *inode)
{}
static inline void
affs_unlock_dir(struct inode *inode)
{}
static inline void
affs_lock_ext(struct inode *inode)
{}
static inline void
affs_unlock_ext(struct inode *inode)
{}