Whamcloud - gitweb
A few missing files...
authorbraam <braam>
Sun, 20 Jan 2002 00:49:49 +0000 (00:49 +0000)
committerbraam <braam>
Sun, 20 Jan 2002 00:49:49 +0000 (00:49 +0000)
lustre/include/linux/lustre_light.h [new file with mode: 0644]
lustre/include/linux/lustre_req.h [new file with mode: 0644]
lustre/obdfilter/.cvsignore [new file with mode: 0644]
lustre/tests/mdcreq.sh [moved from lustre/tests/umreq.sh with 94% similarity]

diff --git a/lustre/include/linux/lustre_light.h b/lustre/include/linux/lustre_light.h
new file mode 100644 (file)
index 0000000..d3969bc
--- /dev/null
@@ -0,0 +1,285 @@
+/* object based disk file system
+ * 
+ * This code is issued under the GNU General Public License.
+ * See the file COPYING in this distribution
+ * 
+ * Copyright (C), 1999, Stelias Computing Inc
+ *
+ *
+ */
+
+
+#ifndef _LL_H
+#define _LL_H
+#include <linux/obd_class.h>
+#include <linux/obdo.h>
+#include <linux/list.h>
+
+#define LL_SUPER_MAGIC 0x0BD00BD0;
+
+struct ll_inode_info {
+        int              lli_flags;
+        struct list_head lli_inodes;
+        struct list_head lli_pages;
+        char             lli_inline[OBD_INLINESZ];
+};
+
+struct ll_sb_info {
+        struct list_head         ll_list;      /* list of supers */
+        struct obd_conn          ll_conn;
+        struct super_block      *ll_super;
+        struct obd_device       *ll_obd;
+        struct obd_ops          *ll_ops;
+        ino_t                    ll_rootino;   /* number of root inode */
+        int                      ll_minor;     /* minor of /dev/obdX */
+        struct list_head         ll_inodes;    /* list of dirty inodes */
+        unsigned long            ll_cache_count;
+        struct semaphore         ll_list_mutex;
+};
+
+
+static inline struct ll_inode_info *ll_i2info(struct inode *inode)
+{
+        return (struct ll_inode_info *)&(inode->u.generic_ip);
+}
+
+static inline int ll_has_inline(struct inode *inode)
+{
+        return (ll_i2info(inode)->lli_flags & OBD_FL_INLINEDATA);
+}
+
+static void inline ll_from_inode(struct obdo *oa, struct inode *inode)
+{
+        struct ll_inode_info *oinfo = ll_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 (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) {
+                CDEBUG(D_INODE, "copying device %x from inode to obdo\n",
+                      inode->i_rdev);
+               *((obd_rdev *)oa->o_inline) = kdev_t_to_nr(inode->i_rdev);
+                oa->o_obdflags |= OBD_FL_INLINEDATA;
+                oa->o_valid |= OBD_MD_FLINLINE;
+       } else if (ll_has_inline(inode)) {
+                CDEBUG(D_INODE, "copying inline data from inode to obdo\n");
+                memcpy(oa->o_inline, oinfo->lli_inline, OBD_INLINESZ);
+                oa->o_obdflags |= OBD_FL_INLINEDATA;
+                oa->o_valid |= OBD_MD_FLINLINE;
+        }
+} /* ll_from_inode */
+
+static void inline ll_to_inode(struct inode *inode, struct obdo *oa)
+{
+        struct ll_inode_info *oinfo = ll_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)) {
+               if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) ||
+                   S_ISFIFO(inode->i_mode)) {
+                       obd_rdev rdev = *((obd_rdev *)oa->o_inline);
+                       CDEBUG(D_INODE,
+                              "copying device %x from obdo to inode\n", rdev);
+                       init_special_inode(inode, inode->i_mode, rdev);
+               } else {
+                       CDEBUG(D_INFO, "copying inline from obdo to inode\n");
+                       memcpy(oinfo->lli_inline, oa->o_inline, OBD_INLINESZ);
+               }
+                oinfo->lli_flags |= OBD_FL_INLINEDATA;
+        }
+} /* ll_to_inode */
+
+
+
+
+/* super.c */ 
+struct ll_pgrq {
+        struct list_head         rq_plist;      /* linked list of req's */
+        unsigned long            rq_jiffies;
+        struct page             *rq_page;       /* page to be written */
+};
+
+extern struct list_head ll_super_list;       /* list of all LL superblocks */
+
+
+
+/* dir.c */
+#define EXT2_DIR_PAD                    4
+#define EXT2_DIR_ROUND                  (EXT2_DIR_PAD - 1)
+#define EXT2_DIR_REC_LEN(name_len)      (((name_len) + 8 + EXT2_DIR_ROUND) & \
+                                         ~EXT2_DIR_ROUND)
+#define EXT2_NAME_LEN 255
+
+int ll_check_dir_entry (const char * function, struct inode * dir,
+                          struct ext2_dir_entry_2 * de, struct page * page,
+                          unsigned long offset);
+extern struct file_operations ll_dir_operations;
+extern struct inode_operations ll_dir_inode_operations;
+
+/* file.c */
+extern struct file_operations ll_file_operations;
+extern struct inode_operations ll_file_inode_operations;
+
+/* flush.c */
+void ll_dequeue_pages(struct inode *inode);
+int ll_flushd_init(void);
+int ll_flushd_cleanup(void);
+int ll_flush_reqs(struct list_head *inode_list, unsigned long check_time);
+int ll_flush_dirty_pages(unsigned long check_time);
+
+/* namei.c */
+/*
+ * Structure of the super block
+ */
+
+
+#define EXT2_SB(sb)     (&((sb)->u.ext2_sb))
+/*
+ * Maximal count of links to a file
+ */
+#define EXT2_LINK_MAX           32000
+/*
+ * Ext2 directory file types.  Only the low 3 bits are used.  The
+ * other bits are reserved for now.
+ */
+#define EXT2_FT_UNKNOWN         0
+#define EXT2_FT_REG_FILE        1
+#define EXT2_FT_DIR             2
+#define EXT2_FT_CHRDEV          3
+#define EXT2_FT_BLKDEV          4
+#define EXT2_FT_FIFO            5
+#define EXT2_FT_SOCK            6
+#define EXT2_FT_SYMLINK         7
+
+#define EXT2_FT_MAX             8
+
+#define EXT2_BTREE_FL                   0x00001000 /* btree format dir */
+#define EXT2_RESERVED_FL                0x80000000 /* reserved for ext2 lib */
+#define EXT2_FEATURE_INCOMPAT_FILETYPE          0x0002
+#define EXT2_HAS_COMPAT_FEATURE(sb,mask)                        \
+        ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask)                      \
+        ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+
+/* rw.c */
+int ll_do_writepage(struct page *, int sync);
+int ll_init_pgrqcache(void);
+void ll_cleanup_pgrqcache(void);
+inline void ll_pgrq_del(struct ll_pgrq *pgrq);
+int ll_readpage(struct file *file, struct page *page);
+int ll_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to);
+int ll_commit_write(struct file *file, struct page *page, unsigned from, unsigned to);
+int ll_writepage(struct page *page);
+struct page *ll_getpage(struct inode *inode, unsigned long offset,
+                           int create, int locked);
+int ll_write_one_page(struct file *file, struct page *page,
+                         unsigned long offset, unsigned long bytes,
+                         const char * buf);
+int ll_do_vec_wr(struct inode **inodes, obd_count num_io, obd_count num_oa,
+                    struct obdo **obdos, obd_count *oa_bufs,
+                    struct page **pages, char **bufs, obd_size *counts,
+                    obd_off *offsets, obd_flag *flags);
+void ll_truncate(struct inode *inode);
+
+/* super.c */
+extern long ll_cache_count;
+extern long ll_mutex_start;
+
+/* symlink.c */
+extern struct inode_operations ll_fast_symlink_inode_operations;
+extern struct inode_operations ll_symlink_inode_operations;
+
+/* sysctl.c */
+void ll_sysctl_init(void);
+void ll_sysctl_clean(void);
+
+static inline struct ll_sb_info *ll_i2sbi(struct inode *inode)
+{
+        return (struct ll_sb_info *) &(inode->i_sb->u.generic_sbp);
+}
+
+static inline struct list_head *ll_iplist(struct inode *inode) 
+{
+        struct ll_inode_info *info = ll_i2info(inode);
+
+        return &info->lli_pages;
+}
+
+static inline struct list_head *ll_islist(struct inode *inode) 
+{
+        struct ll_inode_info *info = ll_i2info(inode);
+
+        return &info->lli_inodes;
+}
+
+static inline struct list_head *ll_slist(struct inode *inode) 
+{
+        struct ll_sb_info *sbi = ll_i2sbi(inode);
+
+        return &sbi->ll_inodes;
+}
+
+static void inline ll_set_size (struct inode *inode, obd_size size)
+{  
+       inode->i_size = size;
+       inode->i_blocks = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
+               inode->i_sb->s_blocksize_bits;
+} /* ll_set_size */
+
+
+
+#define obd_down(mutex) {                                               \
+        /* CDEBUG(D_INFO, "get lock\n"); */                             \
+        ll_mutex_start = jiffies;                                    \
+        down(mutex);                                                    \
+        if (jiffies - ll_mutex_start)                                \
+                CDEBUG(D_CACHE, "waited on mutex %ld jiffies\n",        \
+                       jiffies - ll_mutex_start);                    \
+}
+
+#define obd_up(mutex) {                                                 \
+        up(mutex);                                                      \
+        if (jiffies - ll_mutex_start > 1)                            \
+                CDEBUG(D_CACHE, "held mutex for %ld jiffies\n",         \
+                       jiffies - ll_mutex_start);                    \
+        /* CDEBUG(D_INFO, "free lock\n"); */                            \
+}
+
+/* We track if a page has been added to the OBD page cache by stting a
+ * flag on the page.  We have chosen a bit that will hopefully not be
+ * used for a while.
+ */
+#define PG_obdcache 29
+#define OBDAddCachePage(page)   test_and_set_bit(PG_obdcache, &(page)->flags)
+#define OBDClearCachePage(page) clear_bit(PG_obdcache, &(page)->flags)
+
+static inline void ll_print_plist(struct inode *inode) 
+{
+        struct list_head *page_list = ll_iplist(inode);
+        struct list_head *tmp;
+
+        CDEBUG(D_INFO, "inode %ld: page", inode->i_ino);
+        /* obd_down(&ll_i2sbi(inode)->ll_list_mutex); */
+        if (list_empty(page_list)) {
+                CDEBUG(D_INFO, " list empty\n");
+                obd_up(&ll_i2sbi(inode)->ll_list_mutex);
+                return;
+        }
+
+        tmp = page_list;
+        while ( (tmp = tmp->next) != page_list) {
+                struct ll_pgrq *pgrq;
+                pgrq = list_entry(tmp, struct ll_pgrq, rq_plist);
+                CDEBUG(D_INFO, " %p", pgrq->rq_page);
+        }
+        CDEBUG(D_INFO, "\n");
+        /* obd_up(&ll_i2sbi(inode)->ll_list_mutex); */
+}
+#include <linux/obdo.h>
+
+#endif
+
diff --git a/lustre/include/linux/lustre_req.h b/lustre/include/linux/lustre_req.h
new file mode 100644 (file)
index 0000000..d726766
--- /dev/null
@@ -0,0 +1,32 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ *  Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
+ *
+ *   This file is part of Lustre, http://www.lustre.org.
+ *
+ *   Lustre is free software; you can redistribute it and/or
+ *   modify it under the terms of version 2 of the GNU General Public
+ *   License as published by the Free Software Foundation.
+ *
+ *   Lustre is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with Lustre; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   Definitions related to request handling
+ */
+
+#ifndef __LUSTRE_REQ_H__
+#define __LUSTRE_REQ_H__
+
+struct lustre_connection { 
+       
+
+};
+
+#endif
diff --git a/lustre/obdfilter/.cvsignore b/lustre/obdfilter/.cvsignore
new file mode 100644 (file)
index 0000000..886797f
--- /dev/null
@@ -0,0 +1,9 @@
+config.h
+config.out
+config.mk
+.depfiles
+.prereq.ok
+.ready
+*~
+TAGS
+Xrefs
similarity index 94%
rename from lustre/tests/umreq.sh
rename to lustre/tests/mdcreq.sh
index 94c5cae..42c623b 100644 (file)
@@ -9,6 +9,7 @@ insmod $R/usr/src/obd/ext2obd/obdext2.o
 insmod $R/usr/src/obd/ost/ost.o
 insmod $R/usr/src/obd/osc/osc.o
 insmod $R/usr/src/obd/mds/mds.o
+insmod $R/usr/src/obd/mdc/mdc.o
 insmod $R/usr/src/obd/llight/llight.o
 
 dd if=/dev/zero of=/tmp/fs bs=1024 count=10000