Whamcloud - gitweb
Change in the make system - also minor edits and fixes for compilation.
authorbraam <braam>
Tue, 26 Jun 2001 05:27:40 +0000 (05:27 +0000)
committerbraam <braam>
Tue, 26 Jun 2001 05:27:40 +0000 (05:27 +0000)
lustre/include/linux/inofs.h
lustre/include/linux/obd_ext2.h
lustre/include/linux/obd_raid1.h
lustre/include/linux/obdfs.h
lustre/obdclass/Makefile
lustre/obdfs/Makefile
lustre/obdfs/file.c
lustre/obdfs/super.c
lustre/obdfs/sysctl.c

index 74d9ac3..a5a205d 100644 (file)
@@ -13,6 +13,8 @@
 #define INOFS_H
 #include <linux/obd_class.h>
 
+#include <linux/obdo.h>
+
 /* super.c */
 void inofs_read_inode(struct inode *inode);
 
@@ -36,18 +38,19 @@ int inofs_mknod(struct inode *dir, struct dentry *dentry, int mode, int rdev);
 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);
@@ -60,8 +63,8 @@ extern struct inode_operations inofs_inode_ops;
 
 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
index 1059e58..571958c 100644 (file)
@@ -21,42 +21,8 @@ extern struct file_operations *obd_fso;
 /* 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
index a1ecc41..e28a708 100644 (file)
@@ -27,60 +27,4 @@ extern struct file_operations *obd_fso;
 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
index 3871800..5a0951e 100644 (file)
 #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;
@@ -24,25 +25,7 @@ struct obdfs_pgrq {
 
 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
@@ -50,6 +33,7 @@ struct obdfs_inode_info {
 #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 */
@@ -57,6 +41,7 @@ struct ext2_dir_entry_2 {
         __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);
@@ -78,6 +63,8 @@ int obdfs_flush_dirty_pages(unsigned long check_time);
 /*
  * Structure of the super block
  */
+
+#if 0
 struct ext2_super_block {
         __u32   s_inodes_count;         /* Inodes count */
         __u32   s_blocks_count;         /* Blocks count */
@@ -136,6 +123,7 @@ struct ext2_super_block {
         __u16   s_padding1;
         __u32   s_reserved[204];        /* Padding to the end of the block */
 };
+#endif
 
 #define EXT2_SB(sb)     (&((sb)->u.ext2_sb))
 /*
@@ -211,12 +199,6 @@ extern struct inode_operations obdfs_symlink_inode_operations;
 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);
@@ -290,61 +272,7 @@ static inline void obdfs_print_plist(struct inode *inode)
         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
 
index 5cb821a..cf82363 100644 (file)
@@ -1,4 +1,3 @@
-include ../config.mk
 
 MODULE = obdclass.o
 
index f83021e..d07e8d7 100644 (file)
@@ -1,9 +1,3 @@
-#
-# 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
 
index 7623a9a..7968f10 100644 (file)
@@ -34,7 +34,7 @@
 #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;
 
@@ -63,7 +63,7 @@ obdfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
         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);
         }
index d0d13f6..3545827 100644 (file)
@@ -296,7 +296,6 @@ static void obdfs_put_super(struct super_block *sb)
 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);
@@ -337,7 +336,7 @@ static void obdfs_read_inode(struct inode *inode)
         }
 
         return;
-} /* obdfs_read_inode */
+}
 
 static void obdfs_write_inode(struct inode *inode, int wait) 
 {
index 4970ce3..afbb4d6 100644 (file)
@@ -29,7 +29,6 @@ int obdfs_print_entry = 1;
 #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},
@@ -37,18 +36,17 @@ static ctl_table obdfs_table[] = {
        { 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
 }