linux/fs/reiserfs/super.c

/*
 * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
 *
 * Trivial changes by Alan Cox to add the LFS fixes
 *
 * Trivial Changes:
 * Rights granted to Hans Reiser to redistribute under other terms providing
 * he accepts all liability including but not limited to patent, fitness
 * for purpose, and direct or indirect claims arising from failure to perform.
 *
 * NO WARRANTY
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/time.h>
#include <linux/uaccess.h>
#include "reiserfs.h"
#include "acl.h"
#include "xattr.h"
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/buffer_head.h>
#include <linux/exportfs.h>
#include <linux/quotaops.h>
#include <linux/vfs.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/crc32.h>
#include <linux/seq_file.h>

struct file_system_type reiserfs_fs_type;

static const char reiserfs_3_5_magic_string[] =;
static const char reiserfs_3_6_magic_string[] =;
static const char reiserfs_jr_magic_string[] =;

int is_reiserfs_3_5(struct reiserfs_super_block *rs)
{}

int is_reiserfs_3_6(struct reiserfs_super_block *rs)
{}

int is_reiserfs_jr(struct reiserfs_super_block *rs)
{}

static int is_any_reiserfs_magic_string(struct reiserfs_super_block *rs)
{}

static int reiserfs_remount(struct super_block *s, int *flags, char *data);
static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf);

static int reiserfs_sync_fs(struct super_block *s, int wait)
{}

static void flush_old_commits(struct work_struct *work)
{}

void reiserfs_schedule_old_flush(struct super_block *s)
{}

void reiserfs_cancel_old_flush(struct super_block *s)
{}

static int reiserfs_freeze(struct super_block *s)
{}

static int reiserfs_unfreeze(struct super_block *s)
{}

extern const struct in_core_key MAX_IN_CORE_KEY;

/*
 * this is used to delete "save link" when there are no items of a
 * file it points to. It can either happen if unlink is completed but
 * "save unlink" removal, or if file has both unlink and truncate
 * pending and as unlink completes first (because key of "save link"
 * protecting unlink is bigger that a key lf "save link" which
 * protects truncate), so there left no items to make truncate
 * completion on
 */
static int remove_save_link_only(struct super_block *s,
				 struct reiserfs_key *key, int oid_free)
{}

#ifdef CONFIG_QUOTA
static int reiserfs_quota_on_mount(struct super_block *, int);
#endif

/*
 * Look for uncompleted unlinks and truncates and complete them
 *
 * Called with superblock write locked.  If quotas are enabled, we have to
 * release/retake lest we call dquot_quota_on_mount(), proceed to
 * schedule_on_each_cpu() in invalidate_bdev() and deadlock waiting for the per
 * cpu worklets to complete flush_async_commits() that in turn wait for the
 * superblock write lock.
 */
static int finish_unfinished(struct super_block *s)
{}

/*
 * to protect file being unlinked from getting lost we "safe" link files
 * being unlinked. This link will be deleted in the same transaction with last
 * item of file. mounting the filesystem we scan all these links and remove
 * files which almost got lost
 */
void add_save_link(struct reiserfs_transaction_handle *th,
		   struct inode *inode, int truncate)
{}

/* this opens transaction unlike add_save_link */
int remove_save_link(struct inode *inode, int truncate)
{}

static void reiserfs_kill_sb(struct super_block *s)
{}

#ifdef CONFIG_QUOTA
static int reiserfs_quota_off(struct super_block *sb, int type);

static void reiserfs_quota_off_umount(struct super_block *s)
{}
#else
static inline void reiserfs_quota_off_umount(struct super_block *s)
{
}
#endif

static void reiserfs_put_super(struct super_block *s)
{}

static struct kmem_cache *reiserfs_inode_cachep;

static struct inode *reiserfs_alloc_inode(struct super_block *sb)
{}

static void reiserfs_free_inode(struct inode *inode)
{}

static void init_once(void *foo)
{}

static int __init init_inodecache(void)
{}

static void destroy_inodecache(void)
{}

/* we don't mark inodes dirty, we just log them */
static void reiserfs_dirty_inode(struct inode *inode, int flags)
{}

static int reiserfs_show_options(struct seq_file *seq, struct dentry *root)
{}

#ifdef CONFIG_QUOTA
static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
				    size_t, loff_t);
static ssize_t reiserfs_quota_read(struct super_block *, int, char *, size_t,
				   loff_t);

static struct dquot __rcu **reiserfs_get_dquots(struct inode *inode)
{}
#endif

static const struct super_operations reiserfs_sops =;

#ifdef CONFIG_QUOTA
#define QTYPE2NAME(t)

static int reiserfs_write_dquot(struct dquot *);
static int reiserfs_acquire_dquot(struct dquot *);
static int reiserfs_release_dquot(struct dquot *);
static int reiserfs_mark_dquot_dirty(struct dquot *);
static int reiserfs_write_info(struct super_block *, int);
static int reiserfs_quota_on(struct super_block *, int, int, const struct path *);

static const struct dquot_operations reiserfs_quota_operations =;

static const struct quotactl_ops reiserfs_qctl_operations =;
#endif

static const struct export_operations reiserfs_export_ops =;

/*
 * this struct is used in reiserfs_getopt () for containing the value for
 * those mount options that have values rather than being toggles.
 */
arg_desc_t;

/* Set this bit in arg_required to allow empty arguments */
#define REISERFS_OPT_ALLOWEMPTY

/*
 * this struct is used in reiserfs_getopt() for describing the
 * set of reiserfs mount options
 */
opt_desc_t;

/* possible values for -o data= */
static const arg_desc_t logging_mode[] =;

/* possible values for -o barrier= */
static const arg_desc_t barrier_mode[] =;

/*
 * possible values for "-o block-allocator=" and bits which are to be set in
 * s_mount_opt of reiserfs specific part of in-core super block
 */
static const arg_desc_t balloc[] =;

static const arg_desc_t tails[] =;

static const arg_desc_t error_actions[] =;

/*
 * proceed only one option from a list *cur - string containing of mount
 * options
 * opts - array of options which are accepted
 * opt_arg - if option is found and requires an argument and if it is specifed
 * in the input - pointer to the argument is stored here
 * bit_flags - if option requires to set a certain bit - it is set here
 * return -1 if unknown option is found, opt->arg_required otherwise
 */
static int reiserfs_getopt(struct super_block *s, char **cur, opt_desc_t * opts,
			   char **opt_arg, unsigned long *bit_flags)
{}

/* returns 0 if something is wrong in option string, 1 - otherwise */
static int reiserfs_parse_options(struct super_block *s,

				  /* string given via mount's -o */
				  char *options,

				  /*
				   * after the parsing phase, contains the
				   * collection of bitflags defining what
				   * mount options were selected.
				   */
				  unsigned long *mount_options,

				  /* strtol-ed from NNN of resize=NNN */
				  unsigned long *blocks,
				  char **jdev_name,
				  unsigned int *commit_max_age,
				  char **qf_names,
				  unsigned int *qfmt)
{}

static void switch_data_mode(struct super_block *s, unsigned long mode)
{}

static void handle_data_mode(struct super_block *s, unsigned long mount_options)
{}

static void handle_barrier_mode(struct super_block *s, unsigned long bits)
{}

static void handle_attrs(struct super_block *s)
{}

#ifdef CONFIG_QUOTA
static void handle_quota_files(struct super_block *s, char **qf_names,
			       unsigned int *qfmt)
{}
#endif

static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
{}

static int read_super_block(struct super_block *s, int offset)
{}

/* after journal replay, reread all bitmap and super blocks */
static int reread_meta_blocks(struct super_block *s)
{}

/* hash detection stuff */

/*
 * if root directory is empty - we set default - Yura's - hash and
 * warn about it
 * FIXME: we look for only one name in a directory. If tea and yura
 * both have the same value - we ask user to send report to the
 * mailing list
 */
static __u32 find_hash_out(struct super_block *s)
{}

/* finds out which hash names are sorted with */
static int what_hash(struct super_block *s)
{}

/* return pointer to appropriate function */
static hashf_t hash_function(struct super_block *s)
{}

/* this is used to set up correct value for old partitions */
static int function2code(hashf_t func)
{}

#define SWARN(silent, s, id, ...)

static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
{}

static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf)
{}

#ifdef CONFIG_QUOTA
static int reiserfs_write_dquot(struct dquot *dquot)
{}

static int reiserfs_acquire_dquot(struct dquot *dquot)
{}

static int reiserfs_release_dquot(struct dquot *dquot)
{}

static int reiserfs_mark_dquot_dirty(struct dquot *dquot)
{}

static int reiserfs_write_info(struct super_block *sb, int type)
{}

/*
 * Turn on quotas during mount time - we need to find the quota file and such...
 */
static int reiserfs_quota_on_mount(struct super_block *sb, int type)
{}

/*
 * Standard function to be called on quota_on
 */
static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
			     const struct path *path)
{}

static int reiserfs_quota_off(struct super_block *sb, int type)
{}

/*
 * Read data from quotafile - avoid pagecache and such because we cannot afford
 * acquiring the locks... As quota files are never truncated and quota code
 * itself serializes the operations (and no one else should touch the files)
 * we don't have to be afraid of races
 */
static ssize_t reiserfs_quota_read(struct super_block *sb, int type, char *data,
				   size_t len, loff_t off)
{}

/*
 * Write to quotafile (we know the transaction is already started and has
 * enough credits)
 */
static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
				    const char *data, size_t len, loff_t off)
{}

#endif

static struct dentry *get_super_block(struct file_system_type *fs_type,
			   int flags, const char *dev_name,
			   void *data)
{}

static int __init init_reiserfs_fs(void)
{}

static void __exit exit_reiserfs_fs(void)
{}

struct file_system_type reiserfs_fs_type =;
MODULE_ALIAS_FS();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();

module_init();
module_exit(exit_reiserfs_fs);