Whamcloud - gitweb
Little cleanups:
authorpschwan <pschwan>
Fri, 6 Sep 2002 16:16:33 +0000 (16:16 +0000)
committerpschwan <pschwan>
Fri, 6 Sep 2002 16:16:33 +0000 (16:16 +0000)
- made ll_direct_IO static, because I can
- cleaned up some cut-and-paste bugs in LOV error messages
- fix, I think, the common crash cleaning up /proc entries multiple times
- remove some debugging code from eric's awesome callback race bugfix

lustre/llite/rw.c
lustre/lov/lov_obd.c
lustre/obdclass/proc_lustre.c
lustre/ptlrpc/events.c

index ad6d6cf..8a87af7 100644 (file)
@@ -273,8 +273,8 @@ void ll_truncate(struct inode *inode)
         return;
 } /* ll_truncate */
 
-int ll_direct_IO(int rw, struct inode *inode, struct kiobuf *iobuf,
-                 unsigned long blocknr, int blocksize)
+static int ll_direct_IO(int rw, struct inode *inode, struct kiobuf *iobuf,
+                        unsigned long blocknr, int blocksize)
 {
         obd_count bufs_per_obdo = iobuf->nr_pages;
         struct ll_inode_info *lli = ll_i2info(inode);
@@ -324,7 +324,6 @@ int ll_direct_IO(int rw, struct inode *inode, struct kiobuf *iobuf,
         RETURN(rc);
 }
 
-
 int ll_flush_inode_pages(struct inode * inode)
 {
         obd_count        bufs_per_obdo = 0;
@@ -366,8 +365,6 @@ int ll_flush_inode_pages(struct inode * inode)
         RETURN(err);
 }
 
-
-
 struct address_space_operations ll_aops = {
         readpage: ll_readpage,
         writepage: ll_writepage,
index bbd8bd1..e73cb24 100644 (file)
@@ -304,7 +304,7 @@ static int lov_getattr(struct lustre_handle *conn, struct obdo *oa,
         ENTRY;
 
         if (!md) {
-                CERROR("LOV requires striping ea for destruction\n");
+                CERROR("LOV requires striping ea\n");
                 RETURN(-EINVAL);
         }
 
@@ -361,7 +361,7 @@ static int lov_setattr(struct lustre_handle *conn, struct obdo *oa,
         ENTRY;
 
         if (!md) {
-                CERROR("LOV requires striping ea for desctruction\n");
+                CERROR("LOV requires striping ea\n");
                 RETURN(-EINVAL);
         }
 
@@ -425,7 +425,7 @@ static int lov_close(struct lustre_handle *conn, struct obdo *oa,
         ENTRY;
 
         if (!md) {
-                CERROR("LOV requires striping ea for desctruction\n");
+                CERROR("LOV requires striping ea\n");
                 RETURN(-EINVAL);
         }
 
@@ -582,7 +582,7 @@ static inline int lov_brw(int cmd, struct lustre_handle *conn,
         if (!our_cb)
                 RETURN(-ENOMEM);
 
-        OBD_ALLOC(stripeinfo,  stripe_count * sizeof(*stripeinfo));
+        OBD_ALLOC(stripeinfo, stripe_count * sizeof(*stripeinfo));
         if (!stripeinfo)
                 GOTO(out_cbdata, rc = -ENOMEM);
 
index 5591815..d4dc835 100644 (file)
@@ -171,6 +171,7 @@ void proc_lustre_remove_obd_entry(const char *name, struct obd_device *obd)
 
                 remove_proc_entry(obd_entry->name, obd_dir);
         }
+        obd->obd_proc_entry = NULL;
 }
 
 void proc_lustre_release_obd_device(struct obd_device *obd)
index 8c855bf..df980c7 100644 (file)
@@ -134,32 +134,19 @@ static int bulk_source_callback(ptl_event_t *ev)
                (ev->type == PTL_EVENT_SENT) ? "SENT" :
                (ev->type == PTL_EVENT_ACK)  ? "ACK"  : "UNEXPECTED", ev->type);
 
-        LASSERT (ev->type == PTL_EVENT_SENT ||
-                 ev->type == PTL_EVENT_ACK);
+        LASSERT (ev->type == PTL_EVENT_SENT || ev->type == PTL_EVENT_ACK);
 
         LASSERT (atomic_read (&desc->bd_source_callback_count) > 0 &&
                  atomic_read (&desc->bd_source_callback_count) <= 2);
-        
-        if (ev->mem_desc.niov != desc->bd_page_count)
-        {
-                int mdniov = ev->mem_desc.niov;
-                struct ptlrpc_bulk_desc desc_snapshot;
-
-                desc_snapshot = *desc;
-                
-                printk ("ev(%p)->mem_desc.niov %d != desc(%p)->bd_page_count %d, snapshot %p\n", 
-                        ev, mdniov, desc, desc_snapshot.bd_page_count, &desc_snapshot);
-                LBUG();
-        }
+
         /* 1 fragment for each page always */
         LASSERT (ev->mem_desc.niov == desc->bd_page_count);
 
-        if (atomic_dec_and_test (&desc->bd_source_callback_count))
-        {
+        if (atomic_dec_and_test (&desc->bd_source_callback_count)) {
                 list_for_each_safe(tmp, next, &desc->bd_page_list) {
                         bulk = list_entry(tmp, struct ptlrpc_bulk_page,
                                           bp_link);
-                        
+
                         if (bulk->bp_cb != NULL)
                                 bulk->bp_cb(bulk);
                 }