Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
super.c File Reference
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <linux/time.h>
#include <linux/vmalloc.h>
#include <linux/jbd2.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/blkdev.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/proc_fs.h>
#include <linux/ctype.h>
#include <linux/log2.h>
#include <linux/crc16.h>
#include <linux/cleancache.h>
#include <asm/uaccess.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include "ext4.h"
#include "ext4_extents.h"
#include "ext4_jbd2.h"
#include "xattr.h"
#include "acl.h"
#include "mballoc.h"
#include <trace/events/ext4.h>

Go to the source code of this file.

Data Structures

struct  mount_opts
 
struct  ext4_attr
 
struct  ext4_mount_options
 

Macros

#define CREATE_TRACE_POINTS
 
#define IS_EXT2_SB(sb)   (0)
 
#define IS_EXT3_SB(sb)   (0)
 
#define DEFAULT_JOURNAL_IOPRIO   (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 3))
 
#define MOPT_SET   0x0001
 
#define MOPT_CLEAR   0x0002
 
#define MOPT_NOSUPPORT   0x0004
 
#define MOPT_EXPLICIT   0x0008
 
#define MOPT_CLEAR_ERR   0x0010
 
#define MOPT_GTE0   0x0020
 
#define MOPT_Q   MOPT_NOSUPPORT
 
#define MOPT_QFMT   MOPT_NOSUPPORT
 
#define MOPT_DATAJ   0x0080
 
#define SEQ_OPTS_PUTS(str)   seq_printf(seq, "%c" str, sep)
 
#define SEQ_OPTS_PRINT(str, arg)   seq_printf(seq, "%c" str, sep, arg)
 
#define PLURAL(x)   (x), ((x) == 1) ? "" : "s"
 
#define EXT4_ATTR_OFFSET(_name, _mode, _show, _store, _elname)
 
#define EXT4_ATTR(name, mode, show, store)   static struct ext4_attr ext4_attr_##name = __ATTR(name, mode, show, store)
 
#define EXT4_INFO_ATTR(name)   EXT4_ATTR(name, 0444, NULL, NULL)
 
#define EXT4_RO_ATTR(name)   EXT4_ATTR(name, 0444, name##_show, NULL)
 
#define EXT4_RW_ATTR(name)   EXT4_ATTR(name, 0644, name##_show, name##_store)
 
#define EXT4_RW_ATTR_SBI_UI(name, elname)   EXT4_ATTR_OFFSET(name, 0644, sbi_ui_show, sbi_ui_store, elname)
 
#define ATTR_LIST(name)   &ext4_attr_##name.attr
 

Enumerations

enum  {
  Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid,
  Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont,
  Opt_err_panic, Opt_err_ro, Opt_nouid32, Opt_debug,
  Opt_removed, Opt_user_xattr, Opt_nouser_xattr, Opt_acl,
  Opt_noacl, Opt_auto_da_alloc, Opt_noauto_da_alloc, Opt_noload,
  Opt_commit, Opt_min_batch_time, Opt_max_batch_time, Opt_journal_dev,
  Opt_journal_checksum, Opt_journal_async_commit, Opt_abort, Opt_data_journal,
  Opt_data_ordered, Opt_data_writeback, Opt_data_err_abort, Opt_data_err_ignore,
  Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
  Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota,
  Opt_noquota, Opt_barrier, Opt_nobarrier, Opt_err,
  Opt_usrquota, Opt_grpquota, Opt_i_version, Opt_stripe,
  Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, Opt_nomblk_io_submit,
  Opt_block_validity, Opt_noblock_validity, Opt_inode_readahead_blks, Opt_journal_ioprio,
  Opt_dioread_nolock, Opt_dioread_lock, Opt_discard, Opt_nodiscard,
  Opt_init_itable, Opt_noinit_itable, Opt_max_dir_size_kb
}
 

Functions

int ext4_superblock_csum_verify (struct super_block *sb, struct ext4_super_block *es)
 
void ext4_superblock_csum_set (struct super_block *sb)
 
voidext4_kvmalloc (size_t size, gfp_t flags)
 
voidext4_kvzalloc (size_t size, gfp_t flags)
 
void ext4_kvfree (void *ptr)
 
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)
 
handle_t * ext4_journal_start_sb (struct super_block *sb, int nblocks)
 
int __ext4_journal_stop (const char *where, unsigned int line, handle_t *handle)
 
void ext4_journal_abort_handle (const char *caller, unsigned int line, const char *err_fn, struct buffer_head *bh, handle_t *handle, int err)
 
void __ext4_error (struct super_block *sb, const char *function, unsigned int line, const char *fmt,...)
 
void ext4_error_inode (struct inode *inode, const char *function, unsigned int line, ext4_fsblk_t block, const char *fmt,...)
 
void ext4_error_file (struct file *file, const char *function, unsigned int line, ext4_fsblk_t block, const char *fmt,...)
 
void __ext4_std_error (struct super_block *sb, const char *function, unsigned int line, int errno)
 
void __ext4_abort (struct super_block *sb, const char *function, unsigned int line, const char *fmt,...)
 
void ext4_msg (struct super_block *sb, const char *prefix, const char *fmt,...)
 
void __ext4_warning (struct super_block *sb, 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_update_dynamic_rev (struct super_block *sb)
 
void ext4_clear_inode (struct inode *inode)
 
int ext4_alloc_flex_bg_array (struct super_block *sb, ext4_group_t ngroup)
 
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)
 
 EXT4_RO_ATTR (delayed_allocation_blocks)
 
 EXT4_RO_ATTR (session_write_kbytes)
 
 EXT4_RO_ATTR (lifetime_write_kbytes)
 
 EXT4_ATTR_OFFSET (inode_readahead_blks, 0644, sbi_ui_show, inode_readahead_blks_store, s_inode_readahead_blks)
 
 EXT4_RW_ATTR_SBI_UI (inode_goal, s_inode_goal)
 
 EXT4_RW_ATTR_SBI_UI (mb_stats, s_mb_stats)
 
 EXT4_RW_ATTR_SBI_UI (mb_max_to_scan, s_mb_max_to_scan)
 
 EXT4_RW_ATTR_SBI_UI (mb_min_to_scan, s_mb_min_to_scan)
 
 EXT4_RW_ATTR_SBI_UI (mb_order2_req, s_mb_order2_reqs)
 
 EXT4_RW_ATTR_SBI_UI (mb_stream_req, s_mb_stream_request)
 
 EXT4_RW_ATTR_SBI_UI (mb_group_prealloc, s_mb_group_prealloc)
 
 EXT4_RW_ATTR_SBI_UI (max_writeback_mb_bump, s_max_writeback_mb_bump)
 
 EXT4_RW_ATTR_SBI_UI (extent_max_zeroout_kb, s_extent_max_zeroout_kb)
 
 EXT4_ATTR (trigger_fs_error, 0200, NULL, trigger_test_error)
 
 EXT4_INFO_ATTR (lazy_itable_init)
 
 EXT4_INFO_ATTR (batched_discard)
 
 EXT4_INFO_ATTR (meta_bg_resize)
 
int ext4_calculate_overhead (struct super_block *sb)
 
int ext4_force_commit (struct super_block *sb)
 
 MODULE_AUTHOR ("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others")
 
 MODULE_DESCRIPTION ("Fourth Extended Filesystem")
 
 MODULE_LICENSE ("GPL")
 

Variables

wait_queue_head_t ext4__ioend_wq [EXT4_WQ_HASH_SZ]
 
struct mutex ext4__aio_mutex [EXT4_WQ_HASH_SZ]
 

Macro Definition Documentation

#define ATTR_LIST (   name)    &ext4_attr_##name.attr

Definition at line 2545 of file super.c.

#define CREATE_TRACE_POINTS

Definition at line 54 of file super.c.

#define DEFAULT_JOURNAL_IOPRIO   (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 3))

Definition at line 1331 of file super.c.

#define EXT4_ATTR (   name,
  mode,
  show,
  store 
)    static struct ext4_attr ext4_attr_##name = __ATTR(name, mode, show, store)

Definition at line 2537 of file super.c.

#define EXT4_ATTR_OFFSET (   _name,
  _mode,
  _show,
  _store,
  _elname 
)
Value:
static struct ext4_attr ext4_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode }, \
.show = _show, \
.store = _store, \
.offset = offsetof(struct ext4_sb_info, _elname), \
}

Definition at line 2530 of file super.c.

#define EXT4_INFO_ATTR (   name)    EXT4_ATTR(name, 0444, NULL, NULL)

Definition at line 2540 of file super.c.

#define EXT4_RO_ATTR (   name)    EXT4_ATTR(name, 0444, name##_show, NULL)

Definition at line 2541 of file super.c.

#define EXT4_RW_ATTR (   name)    EXT4_ATTR(name, 0644, name##_show, name##_store)

Definition at line 2542 of file super.c.

#define EXT4_RW_ATTR_SBI_UI (   name,
  elname 
)    EXT4_ATTR_OFFSET(name, 0644, sbi_ui_show, sbi_ui_store, elname)

Definition at line 2543 of file super.c.

#define IS_EXT2_SB (   sb)    (0)

Definition at line 97 of file super.c.

#define IS_EXT3_SB (   sb)    (0)

Definition at line 111 of file super.c.

#define MOPT_CLEAR   0x0002

Definition at line 1394 of file super.c.

#define MOPT_CLEAR_ERR   0x0010

Definition at line 1397 of file super.c.

#define MOPT_DATAJ   0x0080

Definition at line 1406 of file super.c.

#define MOPT_EXPLICIT   0x0008

Definition at line 1396 of file super.c.

#define MOPT_GTE0   0x0020

Definition at line 1398 of file super.c.

#define MOPT_NOSUPPORT   0x0004

Definition at line 1395 of file super.c.

#define MOPT_Q   MOPT_NOSUPPORT

Definition at line 1403 of file super.c.

#define MOPT_QFMT   MOPT_NOSUPPORT

Definition at line 1404 of file super.c.

#define MOPT_SET   0x0001

Definition at line 1393 of file super.c.

#define PLURAL (   x)    (x), ((x) == 1) ? "" : "s"
#define SEQ_OPTS_PRINT (   str,
  arg 
)    seq_printf(seq, "%c" str, sep, arg)
#define SEQ_OPTS_PUTS (   str)    seq_printf(seq, "%c" str, sep)

Enumeration Type Documentation

anonymous enum
Enumerator:
Opt_bsd_df 
Opt_minix_df 
Opt_grpid 
Opt_nogrpid 
Opt_resgid 
Opt_resuid 
Opt_sb 
Opt_err_cont 
Opt_err_panic 
Opt_err_ro 
Opt_nouid32 
Opt_debug 
Opt_removed 
Opt_user_xattr 
Opt_nouser_xattr 
Opt_acl 
Opt_noacl 
Opt_auto_da_alloc 
Opt_noauto_da_alloc 
Opt_noload 
Opt_commit 
Opt_min_batch_time 
Opt_max_batch_time 
Opt_journal_dev 
Opt_journal_checksum 
Opt_journal_async_commit 
Opt_abort 
Opt_data_journal 
Opt_data_ordered 
Opt_data_writeback 
Opt_data_err_abort 
Opt_data_err_ignore 
Opt_usrjquota 
Opt_grpjquota 
Opt_offusrjquota 
Opt_offgrpjquota 
Opt_jqfmt_vfsold 
Opt_jqfmt_vfsv0 
Opt_jqfmt_vfsv1 
Opt_quota 
Opt_noquota 
Opt_barrier 
Opt_nobarrier 
Opt_err 
Opt_usrquota 
Opt_grpquota 
Opt_i_version 
Opt_stripe 
Opt_delalloc 
Opt_nodelalloc 
Opt_mblk_io_submit 
Opt_nomblk_io_submit 
Opt_block_validity 
Opt_noblock_validity 
Opt_inode_readahead_blks 
Opt_journal_ioprio 
Opt_dioread_nolock 
Opt_dioread_lock 
Opt_discard 
Opt_nodiscard 
Opt_init_itable 
Opt_noinit_itable 
Opt_max_dir_size_kb 

Definition at line 1206 of file super.c.

Function Documentation

void __ext4_abort ( struct super_block sb,
const char function,
unsigned int  line,
const char fmt,
  ... 
)

Definition at line 653 of file super.c.

void __ext4_error ( struct super_block sb,
const char function,
unsigned int  line,
const char fmt,
  ... 
)

Definition at line 503 of file super.c.

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,
  ... 
)

Definition at line 704 of file super.c.

int __ext4_journal_stop ( const char where,
unsigned int  line,
handle_t *  handle 
)

Definition at line 355 of file super.c.

void __ext4_std_error ( struct super_block sb,
const char function,
unsigned int  line,
int  errno 
)

Definition at line 622 of file super.c.

void __ext4_warning ( struct super_block sb,
const char function,
unsigned int  line,
const char fmt,
  ... 
)

Definition at line 690 of file super.c.

int ext4_alloc_flex_bg_array ( struct super_block sb,
ext4_group_t  ngroup 
)

Definition at line 1922 of file super.c.

EXT4_ATTR ( trigger_fs_error  ,
0200  ,
NULL  ,
trigger_test_error   
)
EXT4_ATTR_OFFSET ( inode_readahead_blks  ,
0644  ,
sbi_ui_show  ,
inode_readahead_blks_store  ,
s_inode_readahead_blks   
)
ext4_fsblk_t ext4_block_bitmap ( struct super_block sb,
struct ext4_group_desc bg 
)

Definition at line 186 of file super.c.

void ext4_block_bitmap_set ( struct super_block sb,
struct ext4_group_desc bg,
ext4_fsblk_t  blk 
)

Definition at line 242 of file super.c.

int ext4_calculate_overhead ( struct super_block sb)

Definition at line 3197 of file super.c.

void ext4_clear_inode ( struct inode inode)

Definition at line 1028 of file super.c.

void ext4_error_file ( struct file file,
const char function,
unsigned int  line,
ext4_fsblk_t  block,
const char fmt,
  ... 
)

Definition at line 549 of file super.c.

void ext4_error_inode ( struct inode inode,
const char function,
unsigned int  line,
ext4_fsblk_t  block,
const char fmt,
  ... 
)

Definition at line 520 of file super.c.

int ext4_force_commit ( struct super_block sb)

Definition at line 4474 of file super.c.

__u32 ext4_free_group_clusters ( struct super_block sb,
struct ext4_group_desc bg 
)

Definition at line 210 of file super.c.

void ext4_free_group_clusters_set ( struct super_block sb,
struct ext4_group_desc bg,
__u32  count 
)

Definition at line 266 of file super.c.

__u32 ext4_free_inodes_count ( struct super_block sb,
struct ext4_group_desc bg 
)

Definition at line 218 of file super.c.

void ext4_free_inodes_set ( struct super_block sb,
struct ext4_group_desc bg,
__u32  count 
)

Definition at line 274 of file super.c.

void ext4_group_desc_csum_set ( struct super_block sb,
__u32  block_group,
struct ext4_group_desc gdp 
)

Definition at line 2045 of file super.c.

int ext4_group_desc_csum_verify ( struct super_block sb,
__u32  block_group,
struct ext4_group_desc gdp 
)

Definition at line 2034 of file super.c.

EXT4_INFO_ATTR ( lazy_itable_init  )
EXT4_INFO_ATTR ( batched_discard  )
EXT4_INFO_ATTR ( meta_bg_resize  )
ext4_fsblk_t ext4_inode_bitmap ( struct super_block sb,
struct ext4_group_desc bg 
)

Definition at line 194 of file super.c.

void ext4_inode_bitmap_set ( struct super_block sb,
struct ext4_group_desc bg,
ext4_fsblk_t  blk 
)

Definition at line 250 of file super.c.

ext4_fsblk_t ext4_inode_table ( struct super_block sb,
struct ext4_group_desc bg 
)

Definition at line 202 of file super.c.

void ext4_inode_table_set ( struct super_block sb,
struct ext4_group_desc bg,
ext4_fsblk_t  blk 
)

Definition at line 258 of file super.c.

__u32 ext4_itable_unused_count ( struct super_block sb,
struct ext4_group_desc bg 
)

Definition at line 234 of file super.c.

void ext4_itable_unused_set ( struct super_block sb,
struct ext4_group_desc bg,
__u32  count 
)

Definition at line 290 of file super.c.

void ext4_journal_abort_handle ( const char caller,
unsigned int  line,
const char err_fn,
struct buffer_head *  bh,
handle_t *  handle,
int  err 
)

Definition at line 376 of file super.c.

handle_t* ext4_journal_start_sb ( struct super_block sb,
int  nblocks 
)

Definition at line 331 of file super.c.

void ext4_kvfree ( void ptr)

Definition at line 177 of file super.c.

void* ext4_kvmalloc ( size_t  size,
gfp_t  flags 
)

Definition at line 157 of file super.c.

void* ext4_kvzalloc ( size_t  size,
gfp_t  flags 
)

Definition at line 167 of file super.c.

void ext4_msg ( struct super_block sb,
const char prefix,
const char fmt,
  ... 
)

Definition at line 678 of file super.c.

EXT4_RO_ATTR ( delayed_allocation_blocks  )
EXT4_RO_ATTR ( session_write_kbytes  )
EXT4_RO_ATTR ( lifetime_write_kbytes  )
EXT4_RW_ATTR_SBI_UI ( inode_goal  ,
s_inode_goal   
)
EXT4_RW_ATTR_SBI_UI ( mb_stats  ,
s_mb_stats   
)
EXT4_RW_ATTR_SBI_UI ( mb_max_to_scan  ,
s_mb_max_to_scan   
)
EXT4_RW_ATTR_SBI_UI ( mb_min_to_scan  ,
s_mb_min_to_scan   
)
EXT4_RW_ATTR_SBI_UI ( mb_order2_req  ,
s_mb_order2_reqs   
)
EXT4_RW_ATTR_SBI_UI ( mb_stream_req  ,
s_mb_stream_request   
)
EXT4_RW_ATTR_SBI_UI ( mb_group_prealloc  ,
s_mb_group_prealloc   
)
EXT4_RW_ATTR_SBI_UI ( max_writeback_mb_bump  ,
s_max_writeback_mb_bump   
)
EXT4_RW_ATTR_SBI_UI ( extent_max_zeroout_kb  ,
s_extent_max_zeroout_kb   
)
void ext4_superblock_csum_set ( struct super_block sb)

Definition at line 146 of file super.c.

int ext4_superblock_csum_verify ( struct super_block sb,
struct ext4_super_block es 
)

Definition at line 136 of file super.c.

void ext4_update_dynamic_rev ( struct super_block sb)

Definition at line 754 of file super.c.

__u32 ext4_used_dirs_count ( struct super_block sb,
struct ext4_group_desc bg 
)

Definition at line 226 of file super.c.

void ext4_used_dirs_set ( struct super_block sb,
struct ext4_group_desc bg,
__u32  count 
)

Definition at line 282 of file super.c.

MODULE_AUTHOR ( "Remy  Card,
Stephen  Tweedie,
Andrew  Morton,
Andreas  Dilger,
Theodore Ts'o and others"   
)
MODULE_DESCRIPTION ( "Fourth Extended Filesystem"  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation

struct mutex ext4__aio_mutex[EXT4_WQ_HASH_SZ]

Definition at line 5276 of file super.c.

wait_queue_head_t ext4__ioend_wq[EXT4_WQ_HASH_SZ]

Definition at line 5275 of file super.c.