Whamcloud - gitweb
- fixes in fsfilt interface about 2.6/2.4 versions of kernel. Fixes in ext3 implement...
authoryury <yury>
Fri, 3 Dec 2004 09:07:53 +0000 (09:07 +0000)
committeryury <yury>
Fri, 3 Dec 2004 09:07:53 +0000 (09:07 +0000)
- removed not needed lookup_by_path() from lustre_smfs.h
- small cleanups about names of variables to make them coherent with another parts.

lustre/include/linux/lustre_fsfilt.h
lustre/include/linux/lustre_mds.h
lustre/include/linux/lustre_smfs.h
lustre/lov/lov_obd.c
lustre/lvfs/fsfilt_ext3.c
lustre/lvfs/fsfilt_smfs.c
lustre/mdc/mdc_request.c
lustre/mgmt/mgmt_cli.c
lustre/mgmt/mgmt_svc.c
lustre/obdfilter/filter_io_24.c
lustre/obdfilter/filter_io_26.c

index 32cd252..62b5686 100644 (file)
@@ -75,8 +75,7 @@ struct fsfilt_operations {
                                int size);
         int     (* fs_get_sid)(struct inode *inode, void *sid, int size);
 
-        /* this method is needed to make IO operation fsfilt nature depend. */
-        int     (* fs_send_bio)(int rw, struct inode *inode,struct kiobuf *bio);
+        int     (* fs_send_bio)(int rw, struct inode *inode, void *bio);
 
         /* methods for getting page from backing fs and putting page there
          * during IO. Used on OST. */
index 9f9f4df..0ed932f 100644 (file)
@@ -219,8 +219,8 @@ int mdc_enqueue(struct obd_export *exp,
 /* mdc/mdc_request.c */
 int mdc_get_secdesc_size(void);
 void mdc_pack_secdesc(struct ptlrpc_request *req, int size);
-int mdc_req2lustre_md(struct obd_export *exp_mdc, struct ptlrpc_request *req, 
-                      unsigned int offset, struct obd_export *exp_osc
+int mdc_req2lustre_md(struct obd_export *exp_lmv, struct ptlrpc_request *req, 
+                      unsigned int offset, struct obd_export *exp_lov
                       struct lustre_md *md);
 int mdc_getstatus(struct obd_export *exp, struct lustre_id *rootid);
 int mdc_getattr(struct obd_export *exp, struct lustre_id *id,
index b6fd845..fa6dddb 100644 (file)
@@ -451,32 +451,6 @@ static inline void post_smfs_dentry(struct dentry *cache_dentry)
         d_unalloc(cache_dentry);
 }
 
-static inline int lookup_by_path(char *path, int flags, struct nameidata *nd)
-{
-        struct dentry *dentry = NULL;
-        int rc = 0;
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-        if (path_init(path, flags, nd)) {
-#else
-        if (path_lookup(path, flags, nd)) {
-#endif
-                rc = path_walk(path, nd);
-                if (rc)
-                        RETURN(rc);
-        } else {
-                RETURN(-EINVAL);
-        }
-
-        dentry = nd->dentry;
-
-        if (!dentry->d_inode || is_bad_inode(dentry->d_inode)) {
-                path_release(nd);
-                RETURN(-ENODEV);
-        }
-        RETURN(rc);
-}
-
 /*FIXME there should be more conditions in this check*/
 static inline int smfs_do_rec(struct inode *inode)
 {
index b480612..18aa9e4 100644 (file)
@@ -210,7 +210,7 @@ static int lov_connect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt,
 }
 
 static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       struct obd_uuid *cluuid, unsigned long connect_flags)
+                       struct obd_uuid *cluuid, unsigned long flags)
 {
 #ifdef __KERNEL__
         struct proc_dir_entry *lov_proc_dir;
@@ -246,11 +246,11 @@ static int lov_connect(struct lustre_handle *conn, struct obd_device *obd,
 #endif
 
         /* connect_flags is the MDS number, save for use in lov_add_obd */
-        lov->lov_connect_flags = connect_flags;
+        lov->lov_connect_flags = flags;
         for (i = 0, tgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, tgt++) {
                 if (obd_uuid_empty(&tgt->uuid))
                         continue;
-                rc = lov_connect_obd(obd, tgt, 0, connect_flags);
+                rc = lov_connect_obd(obd, tgt, 0, flags);
                 if (rc)
                         GOTO(out_disc, rc);
         }
index 877cfca..a9fb04f 100644 (file)
@@ -550,33 +550,29 @@ static int fsfilt_ext3_get_sid(struct inode *inode, void *sid, int sid_size)
         return rc;
 }
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-static int fsfilt_ext3_send_bio(int rw, struct inode *inode, struct bio *bio)
+static int fsfilt_ext3_send_bio(int rw, struct inode *inode, void *bio)
 {
-        submit_bio(rw, bio);
-        return 0;
-}
+       int rc = 0;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+        submit_bio(rw, (struct bio *)bio);
 #else
-static int fsfilt_ext3_send_bio(int rw, struct inode *inode, struct kiobuf *bio)
-{
-        int rc, blocks_per_page;
-
-        rc = brw_kiovec(rw, 1, &bio, inode->i_dev,
-                        bio->blocks, 1 << inode->i_blkbits);
+       struct bio *b = (struct kiobuf *)bio;
+        int blocks_per_page;
+       
+        rc = brw_kiovec(rw, 1, &b, inode->i_dev,
+                        b->blocks, 1 << inode->i_blkbits);
 
         blocks_per_page = PAGE_SIZE >> inode->i_blkbits;
 
-        if (rc != (1 << inode->i_blkbits) * bio->nr_pages * blocks_per_page) {
+        if (rc != (1 << inode->i_blkbits) * b->nr_pages * blocks_per_page) {
                 CERROR("short write?  expected %d, wrote %d\n",
-                       (1 << inode->i_blkbits) * bio->nr_pages *
+                       (1 << inode->i_blkbits) * b->nr_pages *
                        blocks_per_page, rc);
         }
-
+#endif
         return rc;
 }
-#endif
 
-/* FIXME-UMKA: This should be used in 2.6.x io code later. */
 static struct page *fsfilt_ext3_getpage(struct inode *inode, long int index)
 {
         int rc;
index b0b77b1..acbc93a 100644 (file)
@@ -358,7 +358,7 @@ static int fsfilt_smfs_get_sid(struct inode *inode, void *sid,
                                   cache_fsfilt->fs_get_sid);
 }
 
-static int fsfilt_smfs_send_bio(int rw, struct inode *inode, struct kiobuf *bio)
+static int fsfilt_smfs_send_bio(int rw, struct inode *inode, void *bio)
 {
         struct inode *cache_inode;
         struct fsfilt_operations *cache_fsfilt;
index 6701914..f8a8f08 100644 (file)
@@ -300,8 +300,8 @@ int mdc_store_inode_generation(struct obd_export *exp,
         return 0;
 }
 
-int mdc_req2lustre_md(struct obd_export *exp_mdc, struct ptlrpc_request *req, 
-                      unsigned int offset, struct obd_export *exp_osc
+int mdc_req2lustre_md(struct obd_export *exp_lmv, struct ptlrpc_request *req, 
+                      unsigned int offset, struct obd_export *exp_lov
                       struct lustre_md *md)
 {
         int rc = 0;
@@ -332,7 +332,7 @@ int mdc_req2lustre_md(struct obd_export *exp_mdc, struct ptlrpc_request *req,
                 LASSERT (lmm != NULL);
                 LASSERT_REPSWABBED (req, offset + 1);
 
-                rc = obd_unpackmd(exp_osc, &md->lsm, lmm, lmmsize);
+                rc = obd_unpackmd(exp_lov, &md->lsm, lmm, lmmsize);
                 if (rc >= 0) {
                         LASSERT (rc >= sizeof (*md->lsm));
                         rc = 0;
@@ -340,7 +340,7 @@ int mdc_req2lustre_md(struct obd_export *exp_mdc, struct ptlrpc_request *req,
         } else if (S_ISDIR(md->body->mode)) {
                 struct mea *mea;
                 int mdsize;
-                LASSERT(exp_mdc != NULL);
+                LASSERT(exp_lmv != NULL);
                 
                 /* dir can be non-splitted */
                 if (md->body->eadatasize == 0)
@@ -365,7 +365,7 @@ int mdc_req2lustre_md(struct obd_export *exp_mdc, struct ptlrpc_request *req,
                         
                 LASSERT(id_fid(&mea->mea_ids[0]));
 
-                rc = obd_unpackmd(exp_mdc, (void *)&md->mea,
+                rc = obd_unpackmd(exp_lmv, (void *)&md->mea,
                                   (void *)mea, mdsize);
                 if (rc >= 0) {
                         LASSERT (rc >= sizeof (*md->mea));
index 313a9d5..e7663c5 100644 (file)
@@ -264,7 +264,7 @@ static int __init mgmtcli_init(void)
                               mgmtcli_register_for_events);
         inter_module_register("mgmtcli_deregister_for_events", THIS_MODULE,
                               mgmtcli_deregister_for_events);
-        return class_register_type(&mgmtcli_obd_ops, 0, LUSTRE_MGMTCLI_NAME);
+        return class_register_type(&mgmtcli_obd_ops, NULL, 0, LUSTRE_MGMTCLI_NAME);
 }
 
 static void __exit mgmtcli_exit(void)
index 6d39b2b..f0ff838 100644 (file)
@@ -151,7 +151,8 @@ static struct obd_ops mgmt_obd_ops = {
 
 static int __init mgmt_init(void)
 {
-        int rc = class_register_type(&mgmt_obd_ops, 0, MGMT_DEVICE_NAME);
+        int rc = class_register_type(&mgmt_obd_ops, NULL, 
+                                    0, MGMT_DEVICE_NAME);
 
         return rc;
 }
index 2c59f68..6029329 100644 (file)
@@ -442,4 +442,3 @@ cleanup:
 
         RETURN(rc);
 }
-
index 24e6229..d807f76 100644 (file)
@@ -255,8 +255,6 @@ cleanup:
         RETURN(rc);
 }
 
-
-
 /* See if there are unallocated parts in given file region */
 static int filter_range_is_mapped(struct inode *inode, obd_size offset, int len)
 {