Linux Kernel
3.7.1
|
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/acct.h>
#include <linux/blkdev.h>
#include <linux/mount.h>
#include <linux/security.h>
#include <linux/writeback.h>
#include <linux/idr.h>
#include <linux/mutex.h>
#include <linux/backing-dev.h>
#include <linux/rculist_bl.h>
#include <linux/cleancache.h>
#include <linux/fsnotify.h>
#include <linux/lockdep.h>
#include "internal.h"
Go to the source code of this file.
int __sb_start_write | ( | struct super_block * | sb, |
int | level, | ||
bool | wait | ||
) |
void deactivate_locked_super | ( | struct super_block * | s | ) |
deactivate_locked_super - drop an active reference to superblock : superblock to deactivate
Drops an active reference to superblock, converting it into a temprory one if there is no other active references left. In that case we tell fs driver to shut it down and drop the temporary reference we had just acquired.
Caller holds exclusive lock on superblock; that lock is released.
void deactivate_super | ( | struct super_block * | s | ) |
deactivate_super - drop an active reference to superblock : superblock to deactivate
Variant of deactivate_locked_super(), except that superblock is not locked by caller. If we are going to drop the final active reference, lock will be acquired prior to that.
DEFINE_SPINLOCK | ( | sb_lock | ) |
void drop_super | ( | struct super_block * | sb | ) |
EXPORT_SYMBOL | ( | deactivate_locked_super | ) |
EXPORT_SYMBOL | ( | deactivate_super | ) |
EXPORT_SYMBOL | ( | generic_shutdown_super | ) |
EXPORT_SYMBOL | ( | sget | ) |
EXPORT_SYMBOL | ( | drop_super | ) |
EXPORT_SYMBOL | ( | iterate_supers_type | ) |
EXPORT_SYMBOL | ( | get_super | ) |
EXPORT_SYMBOL | ( | get_super_thawed | ) |
EXPORT_SYMBOL | ( | get_anon_bdev | ) |
EXPORT_SYMBOL | ( | free_anon_bdev | ) |
EXPORT_SYMBOL | ( | set_anon_super | ) |
EXPORT_SYMBOL | ( | kill_anon_super | ) |
EXPORT_SYMBOL | ( | kill_litter_super | ) |
EXPORT_SYMBOL | ( | mount_ns | ) |
EXPORT_SYMBOL | ( | mount_nodev | ) |
EXPORT_SYMBOL | ( | mount_single | ) |
EXPORT_SYMBOL | ( | __sb_end_write | ) |
EXPORT_SYMBOL | ( | __sb_start_write | ) |
EXPORT_SYMBOL | ( | freeze_super | ) |
EXPORT_SYMBOL | ( | thaw_super | ) |
int freeze_super | ( | struct super_block * | sb | ) |
freeze_super - lock the filesystem and force it into a consistent state : the super to lock
Syncs the super to make sure the filesystem is consistent and calls the fs's freeze_fs. Subsequent calls to this without first thawing the fs will return -EBUSY.
During this function, sb->s_writers.frozen goes through these values:
SB_UNFROZEN: File system is normal, all writes progress as usual.
SB_FREEZE_WRITE: The file system is in the process of being frozen. New writes should be blocked, though page faults are still allowed. We wait for all writes to complete and then proceed to the next stage.
SB_FREEZE_PAGEFAULT: Freezing continues. Now also page faults are blocked but internal fs threads can still modify the filesystem (although they should not dirty new pages or inodes), writeback can run etc. After waiting for all running page faults we sync the filesystem which will clean all dirty pages and inodes (no new dirty pages or inodes can be created when sync is running).
SB_FREEZE_FS: The file system is frozen. Now all internal sources of fs modification are blocked (e.g. XFS preallocation truncation on inode reclaim). This is usually implemented by blocking new transactions for filesystems that have them and need this additional guard. After all internal writers are finished we call ->freeze_fs() to finish filesystem freezing. Then we transition to SB_FREEZE_COMPLETE state. This state is mostly auxiliary for filesystems to verify they do not modify frozen fs.
sb->s_writers.frozen is protected by sb->s_umount.
void generic_shutdown_super | ( | struct super_block * | sb | ) |
generic_shutdown_super - common helper for ->kill_sb() : superblock to kill
generic_shutdown_super() does all fs-independent work on superblock shutdown. Typical ->kill_sb() should pick all fs-specific objects that need destruction out of superblock, call generic_shutdown_super() and release aforementioned objects. Note: dentries and inodes are taken care of and do not need specific handling.
Upon calling this function, the filesystem may no longer alter or rearrange the set of dentries belonging to this super_block, nor may it change the attachments of dentries to inodes.
|
read |
|
read |
|
read |
get_super_thawed - get thawed superblock of a device : device to get the superblock for
Scans the superblock list and finds the superblock of the file system mounted on the device. The superblock is returned once it is thawed (or immediately if it was not frozen). NULL is returned if no match is found.
bool grab_super_passive | ( | struct super_block * | sb | ) |
void iterate_supers_type | ( | struct file_system_type * | type, |
void(*)(struct super_block *, void *) | f, | ||
void * | arg | ||
) |
void kill_anon_super | ( | struct super_block * | sb | ) |
void kill_litter_super | ( | struct super_block * | sb | ) |
LIST_HEAD | ( | super_blocks | ) |
|
read |
int thaw_super | ( | struct super_block * | sb | ) |
thaw_super – unlock filesystem : the super to thaw
Unlocks the filesystem and marks it writeable again after freeze_super().
|
read |