#define INOFS_H
#include <linux/obd_class.h>
+#include <linux/obdo.h>
+
/* super.c */
void inofs_read_inode(struct inode *inode);
int inofs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
int inofs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry);
int inofs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry);
+
/* dir.c */
int inofs_readdir(struct file * filp, void * dirent, filldir_t filldir);
-int inofs_check_dir_entry (const char * function, struct inode * dir,
- struct ext2_dir_entry_2 * de,
- struct page * page,
- unsigned long offset);
struct inofs_sb_info {
- struct obd_conn_info osi_conn_info;
- struct super_block *osi_super;
- struct obd_device *osi_obd;
- struct obd_ops *osi_ops;
+ struct list_head osi_list; /* list of supers */
+ struct obd_conn osi_conn;
+ struct super_block *osi_super;
+ struct obd_device *osi_obd;
+ struct obd_ops *osi_ops;
+ struct list_head osi_inodes; /* list of dirty inodes */
+ unsigned long osi_cache_count;
+ struct semaphore osi_list_mutex;
};
void inofs_sysctl_init(void);
static inline struct obd_ops *iops(struct inode *i)
{
- struct inofs_sb_info *sbi = (struct inofs_sb_info *) i->i_sb->u.generic_sbp;
- return sbi->osi_ops;
+ struct inofs_sb_info *sbi = (struct inofs_sb_info *) i->i_sb->u.generic_sbp;
+ return sbi->osi_ops;
}
#define NOLOCK 0
/* ext2_obd.c */
extern struct obd_ops ext2_obd_ops;
-/* balloc.c */
-int ext2_new_block (const struct inode * inode, unsigned long goal,
- u32 * prealloc_count, u32 * prealloc_block, int * err);
-void ext2_free_blocks (const struct inode * inode, unsigned long block,
- unsigned long count);
-unsigned long ext2_count_free_blocks (struct super_block * sb);
-int ext2_group_sparse(int group);
-struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
- unsigned int block_group,
- struct buffer_head ** bh);
-
-/* bitmap.c */
-unsigned long ext2_count_free(struct buffer_head * map, unsigned int numchars);
-
-/* dir.c */
-extern struct inode_operations ext2_dir_inode_operations;
-
-/* file.c */
-extern struct file_operations ext2_file_operations;
-extern struct inode_operations ext2_file_inode_operations;
-
-/* fsync.c */
-int ext2_sync_file(struct file * file, struct dentry *dentry, int);
-
-/* ialloc.c */
-void ext2_free_inode (struct inode * inode);
-struct inode * ext2_new_inode (const struct inode * dir, int );
-unsigned long ext2_count_free_inodes (struct super_block * sb);
-void ext2_check_inodes_bitmap (struct super_block * sb);
-int load_inode_bitmap (struct super_block * sb,
- unsigned int block_group);
-
-/* inode.c */
-int ext2_bmap(struct address_space *mapping, long block);
-int ext2_get_block(struct inode *inode, long iblock, struct buffer_head *bh_result, int create);
+#include <linux/ext2_fs.h>
/* super.c */
#ifdef EXT2_OBD_DEBUG
extern struct obd_ops raid1_obd_ops;
inline long ext2_block_map (struct inode * inode, long block);
-/* balloc.c */
-int ext2_new_block (const struct inode * inode, unsigned long goal,
- u32 * prealloc_count, u32 * prealloc_block, int * err);
-void ext2_free_blocks (const struct inode * inode, unsigned long block,
- unsigned long count);
-unsigned long ext2_count_free_blocks (struct super_block * sb);
-int ext2_group_sparse(int group);
-struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
- unsigned int block_group,
- struct buffer_head ** bh);
-
-/* bitmap.c */
-unsigned long ext2_count_free(struct buffer_head * map, unsigned int numchars);
-
-/* fsync.c */
-extern int obd_sync_file(struct file * file, struct dentry *dentry);
-
-/* ialloc.c */
-extern void ext2_free_inode (struct inode * inode);
-extern struct inode * ext2_new_inode (const struct inode * dir, int mode);
-extern unsigned long ext2_count_free_inodes (struct super_block * sb);
-extern void ext2_check_inodes_bitmap (struct super_block * sb);
-extern int load_inode_bitmap (struct super_block * sb,
- unsigned int block_group);
-
-/* inode.c */
-void obd_read_inode (struct inode * inode);
-void obd_write_inode (struct inode * inode);
-void obd_put_inode (struct inode * inode);
-void obd_delete_inode (struct inode * inode);
-void obd_discard_prealloc_blocks (struct inode * inode);
-int obd_sync_inode (struct inode *inode);
-struct buffer_head * obd_bread (struct inode * inode, int block,
- int create, int *err);
-struct buffer_head * obd_getblk (struct inode * inode, long block,
- int create, int * err);
-
-
-int obd_remount (struct super_block * sb, int * flags, char * data);
-struct super_block * ext2_read_super (struct super_block * sb, void * data,
- int silent);
-
-/* truncate.c */
-void obd_truncate (struct inode * inode);
-
-/* operations */
-/* dir.c */
-extern struct inode_operations ext2_dir_inode_operations;
-
-/* file.c */
-extern struct file_operations ext2_file_operations;
-extern struct inode_operations ext2_file_inode_operations;
-
-/* super.c */
-extern struct super_operations ext2_sops;
-
#endif
#ifndef _OBDFS_H
#define OBDFS_H
#include <linux/obd_class.h>
+#include <linux/obdo.h>
#include <linux/list.h>
-
+/* super.c */
struct obdfs_pgrq {
struct list_head rq_plist; /* linked list of req's */
unsigned long rq_jiffies;
struct list_head obdfs_super_list; /* list of all OBDFS superblocks */
-struct obdfs_sb_info {
- struct list_head osi_list; /* list of supers */
- struct obd_conn osi_conn;
- struct super_block *osi_super;
- struct obd_device *osi_obd;
- struct obd_ops *osi_ops;
- ino_t osi_rootino; /* number of root inode */
- int osi_minor; /* minor of /dev/obdX */
- struct list_head osi_inodes; /* list of dirty inodes */
- unsigned long osi_cache_count;
- struct semaphore osi_list_mutex;
-};
-struct obdfs_inode_info {
- int oi_flags;
- struct list_head oi_inodes;
- struct list_head oi_pages;
- char oi_inline[OBD_INLINESZ];
-};
/* dir.c */
#define EXT2_DIR_PAD 4
#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
~EXT2_DIR_ROUND)
#define EXT2_NAME_LEN 255
+#if 0
struct ext2_dir_entry_2 {
__u32 inode; /* Inode number */
__u16 rec_len; /* Directory entry length */
__u8 file_type;
char name[EXT2_NAME_LEN]; /* File name */
};
+#endif
int obdfs_check_dir_entry (const char * function, struct inode * dir,
struct ext2_dir_entry_2 * de, struct page * page,
unsigned long offset);
/*
* Structure of the super block
*/
+
+#if 0
struct ext2_super_block {
__u32 s_inodes_count; /* Inodes count */
__u32 s_blocks_count; /* Blocks count */
__u16 s_padding1;
__u32 s_reserved[204]; /* Padding to the end of the block */
};
+#endif
#define EXT2_SB(sb) (&((sb)->u.ext2_sb))
/*
void obdfs_sysctl_init(void);
void obdfs_sysctl_clean(void);
-
-static inline struct obdfs_inode_info *obdfs_i2info(struct inode *inode)
-{
- return (struct obdfs_inode_info *)&(inode->u.generic_ip);
-}
-
static inline struct obdfs_sb_info *obdfs_i2sbi(struct inode *inode)
{
return (struct obdfs_sb_info *) &(inode->i_sb->u.generic_sbp);
CDEBUG(D_INFO, "\n");
/* obd_up(&obdfs_i2sbi(inode)->osi_list_mutex); */
}
-
-static inline int obdfs_has_inline(struct inode *inode)
-{
- return (obdfs_i2info(inode)->oi_flags & OBD_FL_INLINEDATA);
-}
-
-static void inline obdfs_from_inode(struct obdo *oa, struct inode *inode)
-{
- struct obdfs_inode_info *oinfo = obdfs_i2info(inode);
-
- CDEBUG(D_INFO, "src inode %ld, dst obdo %ld valid 0x%08x\n",
- inode->i_ino, (long)oa->o_id, oa->o_valid);
- obdo_from_inode(oa, inode);
- if (obdfs_has_inline(inode)) {
- CDEBUG(D_INODE, "copying inline data from inode to obdo\n");
- memcpy(oa->o_inline, oinfo->oi_inline, OBD_INLINESZ);
- oa->o_obdflags |= OBD_FL_INLINEDATA;
- oa->o_valid |= OBD_MD_FLINLINE;
- }
-} /* obdfs_from_inode */
-
-static void inline obdfs_to_inode(struct inode *inode, struct obdo *oa)
-{
- struct obdfs_inode_info *oinfo = obdfs_i2info(inode);
-
- CDEBUG(D_INFO, "src obdo %ld valid 0x%08x, dst inode %ld\n",
- (long)oa->o_id, oa->o_valid, inode->i_ino);
-
- obdo_to_inode(inode, oa);
-
- if (obdo_has_inline(oa)) {
- CDEBUG(D_INODE, "copying inline data from obdo to inode\n");
- memcpy(oinfo->oi_inline, oa->o_inline, OBD_INLINESZ);
- oinfo->oi_flags |= OBD_FL_INLINEDATA;
- }
-} /* obdfs_to_inode */
-
-#define NOLOCK 0
-#define LOCKED 1
-
-#ifdef OPS
-#warning "*** WARNING redefining OPS"
-#else
-#define OPS(sb,op) ((struct obdfs_sb_info *)(& ## sb ## ->u.generic_sbp))->osi_ops->o_ ## op
-#define IOPS(inode,op) ((struct obdfs_sb_info *)(& ## inode->i_sb ## ->u.generic_sbp))->osi_ops->o_ ## op
-#endif
-
-#ifdef ID
-#warning "*** WARNING redefining ID"
-#else
-#define ID(sb) (&((struct obdfs_sb_info *)( & ## sb ## ->u.generic_sbp))->osi_conn)
-#define IID(inode) (&((struct obdfs_sb_info *)( & ## inode->i_sb ## ->u.generic_sbp))->osi_conn)
-#endif
-
-#define OBDFS_SUPER_MAGIC 0x4711
+#include <linux/obdo.h>
#endif
-include ../config.mk
MODULE = obdclass.o
-#
-# Makefile 1.00 Peter Braam <braam@cs.cmu.edu>
-#
-
-include ../config.mk
-
MODULE = obdfs.o
CFILES= flushd.c rw.c file.c dir.c sysctl.c super.c namei.c symlink.c
#include <linux/obd_support.h>
#include <linux/obdfs.h>
-static inline void remove_suid(struct inode *inode)
+static inline void obdfs_remove_suid(struct inode *inode)
{
unsigned int mode;
CDEBUG(D_INFO, "Wrote %d\n", retval);
if (retval > 0) {
struct inode *inode = file->f_dentry->d_inode;
- remove_suid(inode);
+ obdfs_remove_suid(inode);
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
mark_inode_dirty(inode);
}
static void obdfs_read_inode(struct inode *inode)
{
struct obdo *oa;
-
ENTRY;
oa = obdo_fromid(IID(inode), inode->i_ino,
OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS);
}
return;
-} /* obdfs_read_inode */
+}
static void obdfs_write_inode(struct inode *inode, int wait)
{
#define OBDFS_RESET 7
#define OBDFS_VARS_SLOT 2
-#if 0
static ctl_table obdfs_table[] = {
{OBDFS_DEBUG, "debug", &obdfs_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
{ 0 }
};
-static ctl_table jukebox_table[] = {
+static ctl_table top_table[] = {
{OBDFS_SYSCTL, "obdfs", NULL, 0, 0555, obdfs_table},
{0}
};
-#endif
void obdfs_sysctl_init (void)
{
#ifdef CONFIG_SYSCTL
if ( !obdfs_table_header )
- obdfs_table_header = register_sysctl_table(jukebox_table, 0);
+ obdfs_table_header = register_sysctl_table(top_table, 0);
#endif
}