#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <linux/time.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/parser.h>
#include <linux/buffer_head.h>
#include <linux/exportfs.h>
#include <linux/vfs.h>
#include <linux/random.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/quotaops.h>
#include <linux/seq_file.h>
#include <linux/ctype.h>
#include <linux/log2.h>
#include <linux/crc16.h>
#include <linux/dax.h>
#include <linux/uaccess.h>
#include <linux/iversion.h>
#include <linux/unicode.h>
#include <linux/part_stat.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/fsnotify.h>
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
#include "ext4.h"
#include "ext4_extents.h"
#include "ext4_jbd2.h"
#include "xattr.h"
#include "acl.h"
#include "mballoc.h"
#include "fsmap.h"
#define CREATE_TRACE_POINTS
#include <trace/events/ext4.h>
static struct ext4_lazy_init *ext4_li_info;
static DEFINE_MUTEX(ext4_li_mtx);
static struct ratelimit_state ext4_mount_msg_ratelimit;
static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
unsigned long journal_devnum);
static int ext4_show_options(struct seq_file *seq, struct dentry *root);
static void ext4_update_super(struct super_block *sb);
static int ext4_commit_super(struct super_block *sb);
static int ext4_mark_recovery_complete(struct super_block *sb,
struct ext4_super_block *es);
static int ext4_clear_journal_err(struct super_block *sb,
struct ext4_super_block *es);
static int ext4_sync_fs(struct super_block *sb, int wait);
static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
static int ext4_unfreeze(struct super_block *sb);
static int ext4_freeze(struct super_block *sb);
static inline int ext2_feature_set_ok(struct super_block *sb);
static inline int ext3_feature_set_ok(struct super_block *sb);
static void ext4_destroy_lazyinit_thread(void);
static void ext4_unregister_li_request(struct super_block *sb);
static void ext4_clear_request_list(void);
static struct inode *ext4_get_journal_inode(struct super_block *sb,
unsigned int journal_inum);
static int ext4_validate_options(struct fs_context *fc);
static int ext4_check_opt_consistency(struct fs_context *fc,
struct super_block *sb);
static void ext4_apply_options(struct fs_context *fc, struct super_block *sb);
static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param);
static int ext4_get_tree(struct fs_context *fc);
static int ext4_reconfigure(struct fs_context *fc);
static void ext4_fc_free(struct fs_context *fc);
static int ext4_init_fs_context(struct fs_context *fc);
static void ext4_kill_sb(struct super_block *sb);
static const struct fs_parameter_spec ext4_param_specs[];
static const struct fs_context_operations ext4_context_ops = …;
#if !defined(CONFIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT2)
static struct file_system_type ext2_fs_type = {
.owner = THIS_MODULE,
.name = "ext2",
.init_fs_context = ext4_init_fs_context,
.parameters = ext4_param_specs,
.kill_sb = ext4_kill_sb,
.fs_flags = FS_REQUIRES_DEV,
};
MODULE_ALIAS_FS("ext2");
MODULE_ALIAS("ext2");
#define IS_EXT2_SB …
#else
#define IS_EXT2_SB(sb) …
#endif
static struct file_system_type ext3_fs_type = …;
MODULE_ALIAS_FS(…) …;
MODULE_ALIAS(…) …;
#define IS_EXT3_SB(sb) …
static inline void __ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags,
bh_end_io_t *end_io)
{ … }
void ext4_read_bh_nowait(struct buffer_head *bh, blk_opf_t op_flags,
bh_end_io_t *end_io)
{ … }
int ext4_read_bh(struct buffer_head *bh, blk_opf_t op_flags, bh_end_io_t *end_io)
{ … }
int ext4_read_bh_lock(struct buffer_head *bh, blk_opf_t op_flags, bool wait)
{ … }
static struct buffer_head *__ext4_sb_bread_gfp(struct super_block *sb,
sector_t block,
blk_opf_t op_flags, gfp_t gfp)
{ … }
struct buffer_head *ext4_sb_bread(struct super_block *sb, sector_t block,
blk_opf_t op_flags)
{ … }
struct buffer_head *ext4_sb_bread_unmovable(struct super_block *sb,
sector_t block)
{ … }
void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block)
{ … }
static int ext4_verify_csum_type(struct super_block *sb,
struct ext4_super_block *es)
{ … }
__le32 ext4_superblock_csum(struct super_block *sb,
struct ext4_super_block *es)
{ … }
static int ext4_superblock_csum_verify(struct super_block *sb,
struct ext4_super_block *es)
{ … }
void ext4_superblock_csum_set(struct super_block *sb)
{ … }
ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
struct ext4_group_desc *bg)
{ … }
ext4_fsblk_t ext4_inode_bitmap(struct super_block *sb,
struct ext4_group_desc *bg)
{ … }
ext4_fsblk_t ext4_inode_table(struct super_block *sb,
struct ext4_group_desc *bg)
{ … }
__u32 ext4_free_group_clusters(struct super_block *sb,
struct ext4_group_desc *bg)
{ … }
__u32 ext4_free_inodes_count(struct super_block *sb,
struct ext4_group_desc *bg)
{ … }
__u32 ext4_used_dirs_count(struct super_block *sb,
struct ext4_group_desc *bg)
{ … }
__u32 ext4_itable_unused_count(struct super_block *sb,
struct ext4_group_desc *bg)
{ … }
void ext4_block_bitmap_set(struct super_block *sb,
struct ext4_group_desc *bg, ext4_fsblk_t blk)
{ … }
void ext4_inode_bitmap_set(struct super_block *sb,
struct ext4_group_desc *bg, ext4_fsblk_t blk)
{ … }
void ext4_inode_table_set(struct super_block *sb,
struct ext4_group_desc *bg, ext4_fsblk_t blk)
{ … }
void ext4_free_group_clusters_set(struct super_block *sb,
struct ext4_group_desc *bg, __u32 count)
{ … }
void ext4_free_inodes_set(struct super_block *sb,
struct ext4_group_desc *bg, __u32 count)
{ … }
void ext4_used_dirs_set(struct super_block *sb,
struct ext4_group_desc *bg, __u32 count)
{ … }
void ext4_itable_unused_set(struct super_block *sb,
struct ext4_group_desc *bg, __u32 count)
{ … }
static void __ext4_update_tstamp(__le32 *lo, __u8 *hi, time64_t now)
{ … }
static time64_t __ext4_get_tstamp(__le32 *lo, __u8 *hi)
{ … }
#define ext4_update_tstamp(es, tstamp) …
#define ext4_get_tstamp(es, tstamp) …
#define EXT4_SB_REFRESH_INTERVAL_SEC …
#define EXT4_SB_REFRESH_INTERVAL_KB …
static void ext4_maybe_update_superblock(struct super_block *sb)
{ … }
static void ext4_journal_commit_callback(journal_t *journal, transaction_t *txn)
{ … }
static int ext4_journalled_writepage_callback(struct folio *folio,
struct writeback_control *wbc,
void *data)
{ … }
static int ext4_journalled_submit_inode_data_buffers(struct jbd2_inode *jinode)
{ … }
static int ext4_journal_submit_inode_data_buffers(struct jbd2_inode *jinode)
{ … }
static int ext4_journal_finish_inode_data_buffers(struct jbd2_inode *jinode)
{ … }
static bool system_going_down(void)
{ … }
struct ext4_err_translation { … };
#define EXT4_ERR_TRANSLATE(err) …
static struct ext4_err_translation err_translation[] = …;
static int ext4_errno_to_code(int errno)
{ … }
static void save_error_info(struct super_block *sb, int error,
__u32 ino, __u64 block,
const char *func, unsigned int line)
{ … }
static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
__u32 ino, __u64 block,
const char *func, unsigned int line)
{ … }
static void update_super_work(struct work_struct *work)
{ … }
#define ext4_error_ratelimit(sb) …
void __ext4_error(struct super_block *sb, const char *function,
unsigned int line, bool force_ro, int error, __u64 block,
const char *fmt, ...)
{ … }
void __ext4_error_inode(struct inode *inode, const char *function,
unsigned int line, ext4_fsblk_t block, int error,
const char *fmt, ...)
{ … }
void __ext4_error_file(struct file *file, const char *function,
unsigned int line, ext4_fsblk_t block,
const char *fmt, ...)
{ … }
const char *ext4_decode_error(struct super_block *sb, int errno,
char nbuf[16])
{ … }
void __ext4_std_error(struct super_block *sb, const char *function,
unsigned int line, int errno)
{ … }
void __ext4_msg(struct super_block *sb,
const char *prefix, const char *fmt, ...)
{ … }
static int ext4_warning_ratelimit(struct super_block *sb)
{ … }
void __ext4_warning(struct super_block *sb, const char *function,
unsigned int line, const char *fmt, ...)
{ … }
void __ext4_warning_inode(const struct inode *inode, const char *function,
unsigned int line, const char *fmt, ...)
{ … }
void __ext4_grp_locked_error(const char *function, unsigned int line,
struct super_block *sb, ext4_group_t grp,
unsigned long ino, ext4_fsblk_t block,
const char *fmt, ...)
__releases(bitlock)
__acquires(bitlock)
{ … }
void ext4_mark_group_bitmap_corrupted(struct super_block *sb,
ext4_group_t group,
unsigned int flags)
{ … }
void ext4_update_dynamic_rev(struct super_block *sb)
{ … }
static inline struct inode *orphan_list_entry(struct list_head *l)
{ … }
static void dump_orphan_list(struct super_block *sb, struct ext4_sb_info *sbi)
{ … }
#ifdef CONFIG_QUOTA
static int ext4_quota_off(struct super_block *sb, int type);
static inline void ext4_quotas_off(struct super_block *sb, int type)
{ … }
static inline char *get_qf_name(struct super_block *sb,
struct ext4_sb_info *sbi,
int type)
{ … }
#else
static inline void ext4_quotas_off(struct super_block *sb, int type)
{
}
#endif
static int ext4_percpu_param_init(struct ext4_sb_info *sbi)
{ … }
static void ext4_percpu_param_destroy(struct ext4_sb_info *sbi)
{ … }
static void ext4_group_desc_free(struct ext4_sb_info *sbi)
{ … }
static void ext4_flex_groups_free(struct ext4_sb_info *sbi)
{ … }
static void ext4_put_super(struct super_block *sb)
{ … }
static struct kmem_cache *ext4_inode_cachep;
static struct inode *ext4_alloc_inode(struct super_block *sb)
{ … }
static int ext4_drop_inode(struct inode *inode)
{ … }
static void ext4_free_in_core_inode(struct inode *inode)
{ … }
static void ext4_destroy_inode(struct inode *inode)
{ … }
static void ext4_shutdown(struct super_block *sb)
{ … }
static void init_once(void *foo)
{ … }
static int __init init_inodecache(void)
{ … }
static void destroy_inodecache(void)
{ … }
void ext4_clear_inode(struct inode *inode)
{ … }
static struct inode *ext4_nfs_get_inode(struct super_block *sb,
u64 ino, u32 generation)
{ … }
static struct dentry *ext4_fh_to_dentry(struct super_block *sb, struct fid *fid,
int fh_len, int fh_type)
{ … }
static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid,
int fh_len, int fh_type)
{ … }
static int ext4_nfs_commit_metadata(struct inode *inode)
{ … }
#ifdef CONFIG_QUOTA
static const char * const quotatypes[] = INITQFNAMES;
#define QTYPE2NAME(t) …
static int ext4_write_dquot(struct dquot *dquot);
static int ext4_acquire_dquot(struct dquot *dquot);
static int ext4_release_dquot(struct dquot *dquot);
static int ext4_mark_dquot_dirty(struct dquot *dquot);
static int ext4_write_info(struct super_block *sb, int type);
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
const struct path *path);
static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
size_t len, loff_t off);
static ssize_t ext4_quota_write(struct super_block *sb, int type,
const char *data, size_t len, loff_t off);
static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
unsigned int flags);
static struct dquot __rcu **ext4_get_dquots(struct inode *inode)
{ … }
static const struct dquot_operations ext4_quota_operations = …;
static const struct quotactl_ops ext4_qctl_operations = …;
#endif
static const struct super_operations ext4_sops = …;
static const struct export_operations ext4_export_ops = …;
enum { … };
static const struct constant_table ext4_param_errors[] = …;
static const struct constant_table ext4_param_data[] = …;
static const struct constant_table ext4_param_data_err[] = …;
static const struct constant_table ext4_param_jqfmt[] = …;
static const struct constant_table ext4_param_dax[] = …;
static const struct fs_parameter_spec ext4_param_specs[] = …;
#define DEFAULT_JOURNAL_IOPRIO …
#define MOPT_SET …
#define MOPT_CLEAR …
#define MOPT_NOSUPPORT …
#define MOPT_EXPLICIT …
#ifdef CONFIG_QUOTA
#define MOPT_Q …
#define MOPT_QFMT …
#else
#define MOPT_Q …
#define MOPT_QFMT …
#endif
#define MOPT_NO_EXT2 …
#define MOPT_NO_EXT3 …
#define MOPT_EXT4_ONLY …
#define MOPT_SKIP …
#define MOPT_2 …
static const struct mount_opts { … } ext4_mount_opts[] = …;
#if IS_ENABLED(CONFIG_UNICODE)
static const struct ext4_sb_encodings { … } ext4_sb_encoding_map[] = …;
static const struct ext4_sb_encodings *
ext4_sb_read_encoding(const struct ext4_super_block *es)
{ … }
#endif
#define EXT4_SPEC_JQUOTA …
#define EXT4_SPEC_JQFMT …
#define EXT4_SPEC_DATAJ …
#define EXT4_SPEC_SB_BLOCK …
#define EXT4_SPEC_JOURNAL_DEV …
#define EXT4_SPEC_JOURNAL_IOPRIO …
#define EXT4_SPEC_s_want_extra_isize …
#define EXT4_SPEC_s_max_batch_time …
#define EXT4_SPEC_s_min_batch_time …
#define EXT4_SPEC_s_inode_readahead_blks …
#define EXT4_SPEC_s_li_wait_mult …
#define EXT4_SPEC_s_max_dir_size_kb …
#define EXT4_SPEC_s_stripe …
#define EXT4_SPEC_s_resuid …
#define EXT4_SPEC_s_resgid …
#define EXT4_SPEC_s_commit_interval …
#define EXT4_SPEC_s_fc_debug_max_replay …
#define EXT4_SPEC_s_sb_block …
#define EXT4_SPEC_mb_optimize_scan …
struct ext4_fs_context { … };
static void ext4_fc_free(struct fs_context *fc)
{ … }
int ext4_init_fs_context(struct fs_context *fc)
{ … }
#ifdef CONFIG_QUOTA
static int note_qf_name(struct fs_context *fc, int qtype,
struct fs_parameter *param)
{ … }
static int unnote_qf_name(struct fs_context *fc, int qtype)
{ … }
#endif
static int ext4_parse_test_dummy_encryption(const struct fs_parameter *param,
struct ext4_fs_context *ctx)
{ … }
#define EXT4_SET_CTX(name) …
#define EXT4_CLEAR_CTX(name) …
#define EXT4_TEST_CTX(name) …
EXT4_SET_CTX(flags);
EXT4_SET_CTX(mount_opt);
EXT4_CLEAR_CTX(mount_opt);
EXT4_TEST_CTX(mount_opt);
EXT4_SET_CTX(mount_opt2);
EXT4_CLEAR_CTX(mount_opt2);
EXT4_TEST_CTX(mount_opt2);
static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param)
{ … }
static int parse_options(struct fs_context *fc, char *options)
{ … }
static int parse_apply_sb_mount_options(struct super_block *sb,
struct ext4_fs_context *m_ctx)
{ … }
static void ext4_apply_quota_options(struct fs_context *fc,
struct super_block *sb)
{ … }
static int ext4_check_quota_consistency(struct fs_context *fc,
struct super_block *sb)
{ … }
static int ext4_check_test_dummy_encryption(const struct fs_context *fc,
struct super_block *sb)
{ … }
static void ext4_apply_test_dummy_encryption(struct ext4_fs_context *ctx,
struct super_block *sb)
{ … }
static int ext4_check_opt_consistency(struct fs_context *fc,
struct super_block *sb)
{ … }
static void ext4_apply_options(struct fs_context *fc, struct super_block *sb)
{ … }
static int ext4_validate_options(struct fs_context *fc)
{ … }
static inline void ext4_show_quota_options(struct seq_file *seq,
struct super_block *sb)
{ … }
static const char *token2str(int token)
{ … }
static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
int nodefs)
{ … }
static int ext4_show_options(struct seq_file *seq, struct dentry *root)
{ … }
int ext4_seq_options_show(struct seq_file *seq, void *offset)
{ … }
static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es,
int read_only)
{ … }
int ext4_alloc_flex_bg_array(struct super_block *sb, ext4_group_t ngroup)
{ … }
static int ext4_fill_flex_info(struct super_block *sb)
{ … }
static __le16 ext4_group_desc_csum(struct super_block *sb, __u32 block_group,
struct ext4_group_desc *gdp)
{ … }
int ext4_group_desc_csum_verify(struct super_block *sb, __u32 block_group,
struct ext4_group_desc *gdp)
{ … }
void ext4_group_desc_csum_set(struct super_block *sb, __u32 block_group,
struct ext4_group_desc *gdp)
{ … }
static int ext4_check_descriptors(struct super_block *sb,
ext4_fsblk_t sb_block,
ext4_group_t *first_not_zeroed)
{ … }
static loff_t ext4_max_size(int blkbits, int has_huge_files)
{ … }
static loff_t ext4_max_bitmap_size(int bits, int has_huge_files)
{ … }
static ext4_fsblk_t descriptor_loc(struct super_block *sb,
ext4_fsblk_t logical_sb_block, int nr)
{ … }
static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi)
{ … }
int ext4_feature_set_ok(struct super_block *sb, int readonly)
{ … }
static void print_daily_error_info(struct timer_list *t)
{ … }
static int ext4_run_li_request(struct ext4_li_request *elr)
{ … }
static void ext4_remove_li_request(struct ext4_li_request *elr)
{ … }
static void ext4_unregister_li_request(struct super_block *sb)
{ … }
static struct task_struct *ext4_lazyinit_task;
static int ext4_lazyinit_thread(void *arg)
{ … }
static void ext4_clear_request_list(void)
{ … }
static int ext4_run_lazyinit_thread(void)
{ … }
static ext4_group_t ext4_has_uninit_itable(struct super_block *sb)
{ … }
static int ext4_li_info_new(void)
{ … }
static struct ext4_li_request *ext4_li_request_new(struct super_block *sb,
ext4_group_t start)
{ … }
int ext4_register_li_request(struct super_block *sb,
ext4_group_t first_not_zeroed)
{ … }
static void ext4_destroy_lazyinit_thread(void)
{ … }
static int set_journal_csum_feature_set(struct super_block *sb)
{ … }
static int count_overhead(struct super_block *sb, ext4_group_t grp,
char *buf)
{ … }
int ext4_calculate_overhead(struct super_block *sb)
{ … }
static void ext4_set_resv_clusters(struct super_block *sb)
{ … }
static const char *ext4_quota_mode(struct super_block *sb)
{ … }
static void ext4_setup_csum_trigger(struct super_block *sb,
enum ext4_journal_trigger_type type,
void (*trigger)(
struct jbd2_buffer_trigger_type *type,
struct buffer_head *bh,
void *mapped_data,
size_t size))
{ … }
static void ext4_free_sbi(struct ext4_sb_info *sbi)
{ … }
static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb)
{ … }
static void ext4_set_def_opts(struct super_block *sb,
struct ext4_super_block *es)
{ … }
static int ext4_handle_clustersize(struct super_block *sb)
{ … }
static void ext4_fast_commit_init(struct super_block *sb)
{ … }
static int ext4_inode_info_init(struct super_block *sb,
struct ext4_super_block *es)
{ … }
#if IS_ENABLED(CONFIG_UNICODE)
static int ext4_encoding_init(struct super_block *sb, struct ext4_super_block *es)
{ … }
#else
static inline int ext4_encoding_init(struct super_block *sb, struct ext4_super_block *es)
{
return 0;
}
#endif
static int ext4_init_metadata_csum(struct super_block *sb, struct ext4_super_block *es)
{ … }
static int ext4_check_feature_compatibility(struct super_block *sb,
struct ext4_super_block *es,
int silent)
{ … }
static int ext4_check_geometry(struct super_block *sb,
struct ext4_super_block *es)
{ … }
static int ext4_group_desc_init(struct super_block *sb,
struct ext4_super_block *es,
ext4_fsblk_t logical_sb_block,
ext4_group_t *first_not_zeroed)
{ … }
static int ext4_load_and_init_journal(struct super_block *sb,
struct ext4_super_block *es,
struct ext4_fs_context *ctx)
{ … }
static int ext4_check_journal_data_mode(struct super_block *sb)
{ … }
static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
int silent)
{ … }
static void ext4_hash_info_init(struct super_block *sb)
{ … }
static int ext4_block_group_meta_init(struct super_block *sb, int silent)
{ … }
static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
{ … }
static int ext4_fill_super(struct super_block *sb, struct fs_context *fc)
{ … }
static int ext4_get_tree(struct fs_context *fc)
{ … }
static void ext4_init_journal_params(struct super_block *sb, journal_t *journal)
{ … }
static struct inode *ext4_get_journal_inode(struct super_block *sb,
unsigned int journal_inum)
{ … }
static int ext4_journal_bmap(journal_t *journal, sector_t *block)
{ … }
static journal_t *ext4_open_inode_journal(struct super_block *sb,
unsigned int journal_inum)
{ … }
static struct file *ext4_get_journal_blkdev(struct super_block *sb,
dev_t j_dev, ext4_fsblk_t *j_start,
ext4_fsblk_t *j_len)
{ … }
static journal_t *ext4_open_dev_journal(struct super_block *sb,
dev_t j_dev)
{ … }
static int ext4_load_journal(struct super_block *sb,
struct ext4_super_block *es,
unsigned long journal_devnum)
{ … }
static void ext4_update_super(struct super_block *sb)
{ … }
static int ext4_commit_super(struct super_block *sb)
{ … }
static int ext4_mark_recovery_complete(struct super_block *sb,
struct ext4_super_block *es)
{ … }
static int ext4_clear_journal_err(struct super_block *sb,
struct ext4_super_block *es)
{ … }
int ext4_force_commit(struct super_block *sb)
{ … }
static int ext4_sync_fs(struct super_block *sb, int wait)
{ … }
static int ext4_freeze(struct super_block *sb)
{ … }
static int ext4_unfreeze(struct super_block *sb)
{ … }
struct ext4_mount_options { … };
static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
{ … }
static int ext4_reconfigure(struct fs_context *fc)
{ … }
#ifdef CONFIG_QUOTA
static int ext4_statfs_project(struct super_block *sb,
kprojid_t projid, struct kstatfs *buf)
{ … }
#endif
static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
{ … }
#ifdef CONFIG_QUOTA
static inline struct inode *dquot_to_inode(struct dquot *dquot)
{ … }
static int ext4_write_dquot(struct dquot *dquot)
{ … }
static int ext4_acquire_dquot(struct dquot *dquot)
{ … }
static int ext4_release_dquot(struct dquot *dquot)
{ … }
static int ext4_mark_dquot_dirty(struct dquot *dquot)
{ … }
static int ext4_write_info(struct super_block *sb, int type)
{ … }
static void lockdep_set_quota_inode(struct inode *inode, int subclass)
{ … }
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
const struct path *path)
{ … }
static inline bool ext4_check_quota_inum(int type, unsigned long qf_inum)
{ … }
static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
unsigned int flags)
{ … }
int ext4_enable_quotas(struct super_block *sb)
{ … }
static int ext4_quota_off(struct super_block *sb, int type)
{ … }
static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
size_t len, loff_t off)
{ … }
static ssize_t ext4_quota_write(struct super_block *sb, int type,
const char *data, size_t len, loff_t off)
{ … }
#endif
#if !defined(CONFIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT2)
static inline void register_as_ext2(void)
{
int err = register_filesystem(&ext2_fs_type);
if (err)
printk(KERN_WARNING
"EXT4-fs: Unable to register as ext2 (%d)\n", err);
}
static inline void unregister_as_ext2(void)
{
unregister_filesystem(&ext2_fs_type);
}
static inline int ext2_feature_set_ok(struct super_block *sb)
{
if (ext4_has_unknown_ext2_incompat_features(sb))
return 0;
if (sb_rdonly(sb))
return 1;
if (ext4_has_unknown_ext2_ro_compat_features(sb))
return 0;
return 1;
}
#else
static inline void register_as_ext2(void) { … }
static inline void unregister_as_ext2(void) { … }
static inline int ext2_feature_set_ok(struct super_block *sb) { … }
#endif
static inline void register_as_ext3(void)
{ … }
static inline void unregister_as_ext3(void)
{ … }
static inline int ext3_feature_set_ok(struct super_block *sb)
{ … }
static void ext4_kill_sb(struct super_block *sb)
{ … }
static struct file_system_type ext4_fs_type = …;
MODULE_ALIAS_FS(…) …;
wait_queue_head_t ext4__ioend_wq[EXT4_WQ_HASH_SZ];
static int __init ext4_init_fs(void)
{ … }
static void __exit ext4_exit_fs(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_SOFTDEP(…) …;
module_init(…) …
module_exit(…)