Whamcloud - gitweb
The most tedious patch in history. Changes almost all of the 'printk's to
authorpschwan <pschwan>
Sun, 24 Feb 2002 07:09:01 +0000 (07:09 +0000)
committerpschwan <pschwan>
Sun, 24 Feb 2002 07:09:01 +0000 (07:09 +0000)
'CERROR's.  Also contains a lot of cleanup, removing things like __FUNCTION__
from CDEBUG and CERROR statements which already display that information.

21 files changed:
lustre/lib/mds_updates.c
lustre/llite/dir.c
lustre/llite/namei.c
lustre/llite/rw.c
lustre/llite/super.c
lustre/mdc/mdc_reint.c
lustre/mdc/mdc_request.c
lustre/mds/handler.c
lustre/mds/mds_reint.c
lustre/obdclass/class_obd.c
lustre/obdclass/genops.c
lustre/obdclass/proc_lustre.c
lustre/obdclass/sysctl.c
lustre/obdfilter/filter.c
lustre/obdfs/dir.c
lustre/obdfs/namei.c
lustre/obdfs/rw.c
lustre/obdfs/super.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/ptlrpc/rpc.c

index 3ad5158..0444417 100644 (file)
@@ -130,7 +130,7 @@ static int mds_update_hdr_unpack(char *buf, int len, struct mds_update_record *r
        
        r->ur_reclen = NTOH__u32(hdr->ur_reclen);
        if (len < sizeof(*hdr) || len != r->ur_reclen) { 
-               printk(__FUNCTION__ ": invalid buffer length\n"); 
+               CERROR("invalid buffer length\n"); 
                return -EFAULT;
        }
        r->ur_opcode = NTOH__u32(hdr->ur_opcode); 
@@ -144,7 +144,7 @@ static int mds_setattr_unpack(char *buf, int len, struct mds_update_record *r)
        struct mds_rec_setattr *rec = (struct mds_rec_setattr *)buf; 
 
        if (len < sizeof(*rec)) { 
-               printk(__FUNCTION__ "invalid buffer length\n"); 
+               CERROR("invalid buffer length\n"); 
                return -EFAULT;
        }
 
@@ -167,7 +167,7 @@ static int mds_create_unpack(char *buf, int len, struct mds_update_record *r)
        char *ptr, *end;
 
        if (len < sizeof(*rec)) { 
-               printk(__FUNCTION__ "invalid buffer length\n"); 
+               CERROR("invalid buffer length\n"); 
                return -EFAULT;
        }
        
@@ -194,7 +194,7 @@ static int mds_link_unpack(char *buf, int len, struct mds_update_record *r)
        char *ptr, *end;
 
        if (len < sizeof(*rec)) { 
-               printk(__FUNCTION__ "invalid buffer length\n"); 
+               CERROR("invalid buffer length\n"); 
                return -EFAULT;
        }
        
@@ -216,7 +216,7 @@ static int mds_unlink_unpack(char *buf, int len, struct mds_update_record *r)
        ENTRY;
 
        if (len < sizeof(*rec)) { 
-               printk(__FUNCTION__ "invalid buffer length\n"); 
+               CERROR("invalid buffer length\n"); 
                return -EFAULT;
        }
        
@@ -236,7 +236,7 @@ static int mds_rename_unpack(char *buf, int len, struct mds_update_record *r)
        char *ptr, *end;
 
        if (len < sizeof(*rec)) { 
-               printk(__FUNCTION__ "invalid buffer length\n"); 
+               CERROR("invalid buffer length\n"); 
                return -EFAULT;
        }
        
index 83305e8..91097ae 100644 (file)
@@ -203,7 +203,7 @@ out:
        /* Too bad, we had an error */
 
 Ebadsize:
-       printk("ext2_check_page"
+       CERROR("ext2_check_page"
                "size of directory #%lu is not a multiple of chunk size",
                dir->i_ino
        );
@@ -223,7 +223,7 @@ Espan:
        //Einumber:
        // error = "inode out of bounds";
 bad_entry:
-       printk("ext2_check_page: bad entry in directory #%lu: %s - "
+       CERROR("ext2_check_page: bad entry in directory #%lu: %s - "
                "offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
                dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
                (unsigned long) le32_to_cpu(p->inode),
@@ -231,7 +231,7 @@ bad_entry:
        goto fail;
 Eend:
        p = (ext2_dirent *)(kaddr + offs);
-       printk("ext2_check_page"
+       CERROR("ext2_check_page"
                "entry in directory #%lu spans the page boundary"
                "offset=%lu, inode=%lu",
                dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
@@ -528,7 +528,7 @@ int ll_add_link (struct dentry *dentry, struct inode *inode)
                        name_len = EXT2_DIR_REC_LEN(de->name_len);
                        rec_len = le16_to_cpu(de->rec_len);
                        if ( n==npages && rec_len == 0) {
-                               printk("Fatal dir behaviour\n");
+                               CERROR("Fatal dir behaviour\n");
                                goto out_page;
                        }
                        if (!de->inode && rec_len >= reclen)
index 39f5809..4f07f3c 100644 (file)
@@ -101,7 +101,7 @@ static struct dentry *ll_lookup(struct inode * dir, struct dentry *dentry)
        err = mdc_getattr(sbi->ll_peer_ptr, ino, type,
                          OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, &rep, &hdr);
         if ( err ) {
-                printk(__FUNCTION__ ": obdo_fromid failed\n");
+                CERROR("obdo_fromid failed\n");
                 EXIT;
                 return ERR_PTR(-EACCES); 
         }
@@ -171,14 +171,13 @@ static struct inode *ll_create_node(struct inode *dir, const char *name,
 
         inode = iget4(dir->i_sb, rep->ino, NULL, rep);
         if (IS_ERR(inode)) {
-                printk(__FUNCTION__ ": new_inode -fatal:  %ld\n", 
-                      PTR_ERR(inode));
+                CERROR("new_inode -fatal:  %ld\n", PTR_ERR(inode));
                 EXIT;
                 return ERR_PTR(-EIO);
         }
 
         if (!list_empty(&inode->i_dentry)) {
-                printk("new_inode -fatal: aliases %d, ct %d lnk %d\n", 
+                CERROR("new_inode -fatal: aliases %d, ct %d lnk %d\n", 
                       rep->ino, atomic_read(&inode->i_count), 
                       inode->i_nlink);
                 iput(inode);
index e1341a3..bb58088 100644 (file)
@@ -85,7 +85,7 @@ inline struct obdo * ll_oa_from_inode(struct inode *inode, int valid)
         struct ll_inode_info *oinfo = ll_i2info(inode);
        struct obdo *oa = obdo_alloc();
         if ( !oa ) {
-               printk(__FUNCTION__ ": no memory to allocate obdo!\n"); 
+               CERROR("no memory to allocate obdo!\n"); 
                 return NULL;
         }
        oa->o_valid = valid;
@@ -261,7 +261,7 @@ int ll_writepage(struct page *page)
                 SetPageUptodate(page);
                set_page_clean(page);
        } else {
-               printk(__FUNCTION__ ": ll_brw failure %d\n", err);
+               CERROR("ll_brw failure %d\n", err);
        }
         EXIT;
        return err;
@@ -305,7 +305,7 @@ int ll_commit_write(struct file *file, struct page *page,
                /* do NOT truncate */
                err = ll_inode_setattr(inode, &iattr, 0);
                if (err) {
-                       printk(__FUNCTION__ ": failed - %d.\n", err);
+                       CERROR("failed - %d.\n", err);
                        obdo_free(oa);
                        EXIT;
                        return -EIO;
@@ -325,7 +325,7 @@ void ll_truncate(struct inode *inode)
 
        oa = ll_oa_from_inode(inode, OBD_MD_FLNOTOBD);
         if ( !oa ) {
-                printk(__FUNCTION__ ": no memory to allocate obdo!\n");
+                CERROR("no memory to allocate obdo!\n");
                return; 
         } 
        
@@ -335,7 +335,7 @@ void ll_truncate(struct inode *inode)
        obdo_free(oa);
 
         if (err) {
-                printk(__FUNCTION__ ": obd_truncate fails (%d)\n", err);
+                CERROR("obd_truncate fails (%d)\n", err);
         }
         EXIT;
        return; 
index 0ad90bb..8ada5f2 100644 (file)
@@ -60,7 +60,7 @@ static char *ll_read_opt(const char *opt, char *data)
         value++;
         OBD_ALLOC(retval, strlen(value) + 1);
         if ( !retval ) {
-                printk(KERN_ALERT __FUNCTION__ ": out of memory!\n");
+                CERROR("out of memory!\n");
                 return NULL;
         }
         
@@ -111,16 +111,16 @@ static struct super_block * ll_read_super(struct super_block *sb,
         memset(sbi, 0, sizeof(*sbi));
 
         ll_options(data, &device, &version);
-       printk(__FUNCTION__ "line %d\n", __LINE__); 
+
         if ( !device ) {
-                printk(__FUNCTION__ ": no device\n");
+                CERROR("no device\n");
                sb = NULL; 
                 goto ERR;
         }
 
        devno = simple_strtoul(device, NULL, 0);
         if ( devno >= MAX_OBD_DEVICES ) {
-                printk(__FUNCTION__ ": device of %s too high\n", device);
+                CERROR("device of %s too high\n", device);
                sb = NULL; 
                 goto ERR;
         } 
@@ -128,7 +128,7 @@ static struct super_block * ll_read_super(struct super_block *sb,
         sbi->ll_conn.oc_dev = &obd_dev[devno];
         err = obd_connect(&sbi->ll_conn);
         if ( err ) {
-                printk(__FUNCTION__ "cannot connect to %s\n", device);
+                CERROR("cannot connect to %s\n", device);
                sb = NULL; 
                 goto ERR;
         }
@@ -146,14 +146,13 @@ static struct super_block * ll_read_super(struct super_block *sb,
         sb->s_blocksize_bits = (unsigned char)PAGE_SHIFT;
         sb->s_magic = LL_SUPER_MAGIC;
         sb->s_op = &ll_super_operations;
-       printk(__FUNCTION__ "line %d\n", __LINE__); 
 
         /* make root inode */
        err = mdc_getattr(sbi->ll_peer_ptr, sbi->ll_rootino, S_IFDIR, 
                          OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, 
                          &rep, &hdr);
         if (err) {
-                printk(__FUNCTION__ ": mds_getattr failed for root %d\n", err);
+                CERROR("mds_getattr failed for root %d\n", err);
                sb = NULL; 
                 goto ERR;
         }
@@ -162,7 +161,7 @@ static struct super_block * ll_read_super(struct super_block *sb,
         if (root) {
                sb->s_root = d_alloc_root(root);
        } else {
-            printk("lustre_light: bad iget4 for root\n");
+            CERROR("lustre_light: bad iget4 for root\n");
            sb = NULL; 
             goto ERR;
         } 
@@ -208,7 +207,7 @@ static void ll_delete_inode(struct inode *inode)
                struct obdo *oa; 
                oa = ll_oa_from_inode(inode, OBD_MD_FLNOTOBD);
                if (!oa) { 
-                       printk(__FUNCTION__ ": no memory\n"); 
+                       CERROR("no memory\n"); 
                }
 
                err = obd_destroy(IID(inode), oa); 
@@ -266,7 +265,7 @@ int ll_inode_setattr(struct inode *inode, struct iattr *attr, int do_trunc)
 
        err = mdc_setattr(sbi->ll_peer_ptr, inode, attr, NULL, &hdr); 
         if ( err )
-                printk(__FUNCTION__ ": ll_setattr fails (%d)\n", err);
+                CERROR("ll_setattr fails (%d)\n", err);
 
         EXIT;
         return err;
@@ -286,7 +285,7 @@ static int ll_statfs(struct super_block *sb, struct statfs *buf)
 
         err = obd_statfs(ID(sb), &tmp);
         if ( err ) { 
-                printk(__FUNCTION__ ": obd_statfs fails (%d)\n", err);
+                CERROR("obd_statfs fails (%d)\n", err);
                 return err;
         }
        memcpy(buf, &tmp, sizeof(*buf));
index 7ac96e2..383f629 100644 (file)
@@ -63,7 +63,7 @@ int mdc_setattr(struct lustre_peer *peer,
 
        request = mds_prep_req(MDS_REINT, 0, NULL, sizeof(*rec), NULL);
        if (!request) { 
-               printk("mdc request: cannot pack\n");
+               CERROR("mdc request: cannot pack\n");
                return -ENOMEM;
        }
 
@@ -101,7 +101,7 @@ int mdc_create(struct lustre_peer *peer,
                               sizeof(*rec) + size_round0(namelen) + 
                               size_round0(tgtlen), NULL);
        if (!request) { 
-               printk("mdc_create: cannot pack\n");
+               CERROR("mdc_create: cannot pack\n");
                return -ENOMEM;
        }
 
@@ -136,7 +136,7 @@ int mdc_unlink(struct lustre_peer *peer,
        request = mds_prep_req(MDS_REINT, 0, NULL, 
                               sizeof(*rec) + size_round0(namelen), NULL);
        if (!request) { 
-               printk("mdc_unlink: cannot pack\n");
+               CERROR("mdc_unlink: cannot pack\n");
                return -ENOMEM;
        }
 
@@ -170,7 +170,7 @@ int mdc_link(struct lustre_peer *peer, struct dentry *src,
        request = mds_prep_req(MDS_REINT, 0, NULL, 
                               sizeof(*rec) + size_round0(namelen), NULL);
        if (!request) { 
-               printk("mdc_link: cannot pack\n");
+               CERROR("mdc_link: cannot pack\n");
                return -ENOMEM;
        }
 
@@ -206,7 +206,7 @@ int mdc_rename(struct lustre_peer *peer, struct inode *src,
                               sizeof(*rec) + size_round0(oldlen)
                               + size_round0(newlen), NULL);
        if (!request) { 
-               printk("mdc_link: cannot pack\n");
+               CERROR("mdc_link: cannot pack\n");
                return -ENOMEM;
        }
 
index 600e453..7cf604d 100644 (file)
@@ -65,7 +65,7 @@ struct ptlrpc_request *mds_prep_req(int opcode, int namelen, char *name,
 
        OBD_ALLOC(request, sizeof(*request));
        if (!request) { 
-               printk("mds_prep_req: request allocation out of memory\n");
+               CERROR("request allocation out of memory\n");
                return NULL;
        }
 
@@ -76,10 +76,10 @@ struct ptlrpc_request *mds_prep_req(int opcode, int namelen, char *name,
                          &request->rq_reqhdr, &(request->rq_req.mds),
                          &request->rq_reqlen, &request->rq_reqbuf);
        if (rc) { 
-               printk("llight request: cannot pack request %d\n", rc); 
+               CERROR("llight request: cannot pack request %d\n", rc); 
                return NULL;
        }
-        CDEBUG(0, "--> mds_prep_req: len %d, req %p, tgtlen %d\n", 
+        CDEBUG(0, "--> len %d, req %p, tgtlen %d\n", 
               request->rq_reqlen, request->rq_req.mds, 
               request->rq_req.mds->tgtlen);
        request->rq_reqhdr->opc = opcode;
@@ -104,7 +104,7 @@ static int mds_queue_wait(struct ptlrpc_request *req, struct lustre_peer *peer)
                rc = ptl_send_rpc(req, peer);
        }
        if (rc) { 
-               printk(__FUNCTION__ ": error %d, opcode %d\n", rc, 
+               CERROR("error %d, opcode %d\n", rc, 
                       req->rq_reqhdr->opc); 
                return -rc;
        }
@@ -117,7 +117,7 @@ static int mds_queue_wait(struct ptlrpc_request *req, struct lustre_peer *peer)
        rc = mds_unpack_rep(req->rq_repbuf, req->rq_replen, &req->rq_rephdr, 
                            &req->rq_rep.mds);
        if (rc) {
-               printk(__FUNCTION__ ": mds_unpack_rep failed: %d\n", rc);
+               CERROR("mds_unpack_rep failed: %d\n", rc);
                return rc;
        }
 
@@ -143,7 +143,7 @@ int mdc_getattr(struct lustre_peer *peer, ino_t ino, int type, int valid,
 
        request = mds_prep_req(MDS_GETATTR, 0, NULL, 0, NULL); 
        if (!request) { 
-               printk("llight request: cannot pack\n");
+               CERROR("llight request: cannot pack\n");
                return -ENOMEM;
        }
 
@@ -155,7 +155,7 @@ int mdc_getattr(struct lustre_peer *peer, ino_t ino, int type, int valid,
 
        rc = mds_queue_wait(request, peer);
        if (rc) { 
-               printk("llight request: error in handling %d\n", rc); 
+               CERROR("llight request: error in handling %d\n", rc); 
                goto out;
        }
 
@@ -187,7 +187,7 @@ int mdc_readpage(struct lustre_peer *peer, ino_t ino, int type, __u64 offset,
        request = mds_prep_req(MDS_READPAGE, 0, NULL,
                               sizeof(struct niobuf), (char *)&niobuf);
        if (!request) { 
-               printk("mdc request: cannot pack\n");
+               CERROR("mdc request: cannot pack\n");
                return -ENOMEM;
        }
 
@@ -202,7 +202,7 @@ int mdc_readpage(struct lustre_peer *peer, ino_t ino, int type, __u64 offset,
 
        rc = mds_queue_wait(request, peer);
        if (rc) { 
-               printk("mdc request: error in handling %d\n", rc); 
+               CERROR("mdc request: error in handling %d\n", rc); 
                goto out;
        }
 
@@ -226,7 +226,7 @@ int mdc_reint(struct lustre_peer *peer, struct ptlrpc_request *request)
 
        rc = mds_queue_wait(request, peer);
        if (rc) { 
-               printk("mdc request: error in handling %d\n", rc); 
+               CERROR("mdc request: error in handling %d\n", rc); 
        }
 
        return rc;
@@ -262,14 +262,14 @@ static int request_ioctl(struct inode *inode, struct file *file,
        switch (cmd) {
        case IOC_REQUEST_GETATTR: { 
                struct ptlrep_hdr *hdr = NULL;
-               printk("-- getting attr for ino 2\n"); 
+               CERROR("-- getting attr for ino 2\n"); 
                err = mdc_getattr(peer_ptr, 2, S_IFDIR, ~0, NULL, &hdr);
                if (hdr) {
                         /* FIXME: there must be a better way to get the size */
                        OBD_FREE(hdr, sizeof(struct ptlrep_hdr) +
                                  sizeof(struct mds_rep));
                 }
-               printk("-- done err %d\n", err);
+               CERROR("-- done err %d\n", err);
                break;
        }
 
@@ -281,11 +281,11 @@ static int request_ioctl(struct inode *inode, struct file *file,
                        err = -ENOMEM;
                        break;
                }
-               printk("-- readpage 0 for ino 2\n"); 
+               CERROR("-- readpage 0 for ino 2\n"); 
                err = mdc_readpage(peer_ptr, 2, S_IFDIR, 0, buf, NULL, &hdr);
-               printk("-- done err %d\n", err);
+               CERROR("-- done err %d\n", err);
                if (!err) { 
-                       printk("-- status: %d\n", hdr->status); 
+                       CERROR("-- status: %d\n", hdr->status); 
                        err = hdr->status;
                         if (hdr)
                                 OBD_FREE(hdr, sizeof(struct ptlrep_hdr) +
@@ -306,9 +306,9 @@ static int request_ioctl(struct inode *inode, struct file *file,
                iattr.ia_valid = ATTR_MODE | ATTR_ATIME;
 
                err = mdc_setattr(peer_ptr, &inode, &iattr, NULL, &hdr);
-               printk("-- done err %d\n", err);
+               CERROR("-- done err %d\n", err);
                if (!err) { 
-                       printk("-- status: %d\n", hdr->status); 
+                       CERROR("-- status: %d\n", hdr->status); 
                        err = hdr->status;
                } else {
                         OBD_FREE(hdr, sizeof(struct ptlrep_hdr) +
@@ -331,9 +331,9 @@ static int request_ioctl(struct inode *inode, struct file *file,
                                 "foofile", strlen("foofile"), 
                                 NULL, 0, 0100707, 47114711, 
                                 11, 47, 0, NULL, &hdr);
-               printk("-- done err %d\n", err);
+               CERROR("-- done err %d\n", err);
                if (!err) { 
-                       printk("-- status: %d\n", hdr->status); 
+                       CERROR("-- status: %d\n", hdr->status); 
                        err = hdr->status;
                }
                 OBD_FREE(hdr, sizeof(struct ptlrep_hdr) +
index 130f805..cd83e69 100644 (file)
@@ -198,8 +198,7 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid,
            || (generation && inode->i_generation != generation)
                ) {
                /* we didn't find the right inode.. */
-               printk(__FUNCTION__ 
-                      "bad inode %lu, link: %d ct: %d or version  %u/%u\n",
+               CERROR("bad inode %lu, link: %d ct: %d or version  %u/%u\n",
                        inode->i_ino,
                        inode->i_nlink, atomic_read(&inode->i_count),
                        inode->i_generation,
@@ -254,7 +253,7 @@ int mds_getattr(struct ptlrpc_request *req)
                          &req->rq_replen, &req->rq_repbuf);
        if (rc) { 
                EXIT;
-               printk("mds: out of memory\n");
+               CERROR("mds: out of memory\n");
                req->rq_status = -ENOMEM;
                return 0;
        }
@@ -298,7 +297,7 @@ int mds_readpage(struct ptlrpc_request *req)
                          &req->rq_replen, &req->rq_repbuf);
        if (rc) { 
                EXIT;
-               printk("mds: out of memory\n");
+               CERROR("mds: out of memory\n");
                req->rq_status = -ENOMEM;
                return 0;
        }
@@ -345,7 +344,7 @@ int mds_reint(struct ptlrpc_request *req)
        
        rc = mds_update_unpack(buf, len, &rec);
        if (rc) { 
-               printk(__FUNCTION__ ": invalid record\n");
+               CERROR("invalid record\n");
                req->rq_status = -EINVAL;
                return 0;
        }
@@ -365,7 +364,7 @@ int mds_handle(struct ptlrpc_request *req)
        hdr = (struct ptlreq_hdr *)req->rq_reqbuf;
 
        if (NTOH__u32(hdr->type) != MDS_TYPE_REQ) {
-               printk("lustre_mds: wrong packet type sent %d\n",
+               CERROR("lustre_mds: wrong packet type sent %d\n",
                       NTOH__u32(hdr->type));
                rc = -EINVAL;
                goto out;
@@ -374,7 +373,7 @@ int mds_handle(struct ptlrpc_request *req)
        rc = mds_unpack_req(req->rq_reqbuf, req->rq_reqlen, 
                            &req->rq_reqhdr, &req->rq_req.mds);
        if (rc) { 
-               printk("lustre_mds: Invalid request\n");
+               CERROR("lustre_mds: Invalid request\n");
                EXIT; 
                goto out;
        }
@@ -402,7 +401,7 @@ int mds_handle(struct ptlrpc_request *req)
 
 out:
        if (rc) { 
-               printk(__FUNCTION__ ": no header\n");
+               CERROR("no header\n");
                return 0;
        }
 
@@ -516,7 +515,7 @@ int mds_main(void *arg)
 
        mds->mds_thread = NULL;
        wake_up(&mds->mds_done_waitq);
-       printk("lustre_mds: exiting\n");
+       CERROR("lustre_mds: exiting\n");
        return 0;
 }
 
@@ -615,7 +614,7 @@ static int mds_cleanup(struct obd_device * obddev)
         }
 
         if ( !list_empty(&obddev->obd_gen_clients) ) {
-                printk(KERN_WARNING __FUNCTION__ ": still has clients!\n");
+                CERROR("still has clients!\n");
                 EXIT;
                 return -EBUSY;
         }
index 7eeed71..69865ec 100644 (file)
@@ -107,7 +107,7 @@ static int mds_reint_create(struct mds_update_record *rec,
        dchild = lookup_one_len(rec->ur_name, de, rec->ur_namelen - 1);
        rc = PTR_ERR(dchild);
        if (IS_ERR(dchild)) { 
-               printk(__FUNCTION__ "child lookup error %d\n", rc);
+               CERROR("child lookup error %d\n", rc);
                dput(de); 
                req->rq_rephdr->status = -ESTALE;
                EXIT;
@@ -115,7 +115,7 @@ static int mds_reint_create(struct mds_update_record *rec,
        }
 
        if (dchild->d_inode) {
-               printk(__FUNCTION__ "child exists (dir %ld, name %s\n", 
+               CERROR("child exists (dir %ld, name %s\n", 
                       de->d_inode->i_ino, rec->ur_name);
                dput(de); 
                req->rq_rephdr->status = -ESTALE;
@@ -188,7 +188,7 @@ static int mds_reint_unlink(struct mds_update_record *rec,
        dchild = lookup_one_len(rec->ur_name, de, rec->ur_namelen - 1);
        rc = PTR_ERR(dchild);
        if (IS_ERR(dchild)) { 
-               printk(__FUNCTION__ ": child lookup error %d\n", rc);
+               CERROR("child lookup error %d\n", rc);
                dput(de); 
                req->rq_rephdr->status = -ESTALE;
                EXIT;
@@ -196,7 +196,7 @@ static int mds_reint_unlink(struct mds_update_record *rec,
        }
 
        if (!dchild->d_inode) {
-               printk(__FUNCTION__ ": child doesn't exist (dir %ld, name %s\n", 
+               CERROR("child doesn't exist (dir %ld, name %s\n", 
                       de->d_inode->i_ino, rec->ur_name);
                dput(de); 
                req->rq_rephdr->status = -ESTALE;
@@ -248,13 +248,13 @@ static int mds_reint_link(struct mds_update_record *rec,
 
        dchild = lookup_one_len(rec->ur_name, de_tgt_dir, rec->ur_namelen - 1);
        if (IS_ERR(dchild)) { 
-               printk(__FUNCTION__ ": child lookup error %d\n", rc);
+               CERROR("child lookup error %d\n", rc);
                req->rq_rephdr->status = -ESTALE;
                goto out_link;
        }
 
        if (dchild->d_inode) {
-               printk(__FUNCTION__ ": child exists (dir %ld, name %s\n", 
+               CERROR("child exists (dir %ld, name %s\n", 
                       de_tgt_dir->d_inode->i_ino, rec->ur_name);
                EXIT;
                goto out_link;
@@ -298,13 +298,13 @@ static int mds_reint_rename(struct mds_update_record *rec,
 
        de_old = lookup_one_len(rec->ur_name, de_srcdir, rec->ur_namelen - 1);
        if (IS_ERR(de_old)) { 
-               printk(__FUNCTION__ "child lookup error %d\n", rc);
+               CERROR("child lookup error %d\n", rc);
                goto out_rename;
        }
 
        de_new = lookup_one_len(rec->ur_tgt, de_tgtdir, rec->ur_tgtlen - 1);
        if (IS_ERR(de_new)) { 
-               printk(__FUNCTION__ "child lookup error %d\n", rc);
+               CERROR("child lookup error %d\n", rc);
                goto out_rename;
        }
 
@@ -335,7 +335,7 @@ int mds_reint_rec(struct mds_update_record *rec, struct ptlrpc_request *req)
        int rc; 
 
        if (rec->ur_opcode < 0 || rec->ur_opcode > REINT_MAX) { 
-               printk(__FUNCTION__ "opcode %d not valid\n", 
+               CERROR("opcode %d not valid\n", 
                       rec->ur_opcode); 
                rc = req->rq_status = -EINVAL;
                return rc;
@@ -345,7 +345,7 @@ int mds_reint_rec(struct mds_update_record *rec, struct ptlrpc_request *req)
                          &req->rq_replen, &req->rq_repbuf);
        if (rc) { 
                EXIT;
-               printk("mds: out of memory\n");
+               CERROR("mds: out of memory\n");
                rc = req->rq_status = -ENOMEM;
                return rc;
        }
index 70dd8e0..e723a5f 100644 (file)
@@ -142,11 +142,11 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
        memset(buf, 0, sizeof(buf));
 
        if (!obd && cmd != OBD_IOC_DEVICE && cmd != TCGETS) {
-               printk("OBD ioctl: No device\n");
+               CERROR("OBD ioctl: No device\n");
                return -EINVAL;
        } 
        if (obd_ioctl_getdata(buf, buf + 800, (void *)arg)) { 
-               printk("OBD ioctl: data error\n");
+               CERROR("OBD ioctl: data error\n");
                return -EINVAL;
        }
        data = (struct obd_ioctl_data *)buf;
@@ -160,7 +160,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
                CDEBUG(D_IOCTL, "\n");
                if (data->ioc_dev >= MAX_OBD_DEVICES ||
                    data->ioc_dev < 0) { 
-                       printk("OBD ioctl: DEVICE insufficient devices\n");
+                       CERROR("OBD ioctl: DEVICE insufficient devices\n");
                        return -EINVAL;
                }
                CDEBUG(D_IOCTL, "device %d\n", data->ioc_dev);
@@ -176,18 +176,18 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
                 ENTRY;
                 /* have we attached a type to this device */
                 if ( obd->obd_flags & OBD_ATTACHED ) {
-                        printk("OBD: Device %d already typed as  %s.\n",
+                        CERROR("OBD: Device %d already typed as  %s.\n",
                                obd->obd_minor, MKSTR(obd->obd_type->typ_name));
                         return -EBUSY;
                 }
 
-               printk("-----> attach %s %s\n",  MKSTR(data->ioc_inlbuf1), 
+               CDEBUG(D_IOCTL, "attach %s %s\n",  MKSTR(data->ioc_inlbuf1), 
                       MKSTR(data->ioc_inlbuf2));
 
                 /* find the type */
                 type = obd_nm_to_type(data->ioc_inlbuf1);
                 if ( !type ) {
-                        printk("OBD: unknown type dev %d\n", obd->obd_minor);
+                        CERROR("OBD: unknown type dev %d\n", obd->obd_minor);
                         return -EINVAL;
                 }
 
@@ -206,7 +206,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
                 } else {
                         obd->obd_flags |=  OBD_ATTACHED;
                         type->typ_refcnt++;
-                        printk("OBD: dev %d attached type %s\n", 
+                        CDEBUG(D_IOCTL, "OBD: dev %d attached type %s\n", 
                               obd->obd_minor, data->ioc_inlbuf1);
                        obd->obd_proc_entry = 
                                proc_lustre_register_obd_device(obd);
@@ -220,15 +220,16 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
         case OBD_IOC_DETACH: {
                 ENTRY;
                 if (obd->obd_flags & OBD_SET_UP) {
-                        printk("OBD device %d still set up\n", obd->obd_minor);
+                        CERROR("OBD device %d still set up\n", obd->obd_minor);
                         return -EBUSY;
                 }
                 if (! (obd->obd_flags & OBD_ATTACHED) ) {
-                        printk("OBD device %d not attached\n", obd->obd_minor);
+                        CERROR("OBD device %d not attached\n", obd->obd_minor);
                         return -ENODEV;
                 }
                 if ( !list_empty(&obd->obd_gen_clients) ) {
-                        printk("OBD device %d has connected clients\n", obd->obd_minor);
+                        CERROR("OBD device %d has connected clients\n",
+                               obd->obd_minor);
                         return -EBUSY;
                 }
 
@@ -247,13 +248,13 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
                 ENTRY;
                 /* have we attached a type to this device? */
                 if (!(obd->obd_flags & OBD_ATTACHED)) {
-                        printk("Device %d not attached\n", obd->obd_minor);
+                        CERROR("Device %d not attached\n", obd->obd_minor);
                         return -ENODEV;
                 }
 
                 /* has this been done already? */
                 if ( obd->obd_flags & OBD_SET_UP ) {
-                        printk("Device %d already setup (type %s)\n",
+                        CERROR("Device %d already setup (type %s)\n",
                                obd->obd_minor, obd->obd_type->typ_name);
                         return -EBUSY;
                 }
@@ -660,7 +661,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp,
 #endif
                 OBD_FREE(input.att_type, input.att_typelen + 1);
                 if ( !type ) {
-                        printk(__FUNCTION__ ": unknown obd type dev %d\n", dev);
+                        CERROR("unknown obd type dev %d\n", dev);
                         EXIT;
                         return -EINVAL;
                 }
@@ -703,7 +704,7 @@ int obd_register_type(struct obd_ops *ops, char *nm)
         struct obd_type *type;
 
         if (obd_init_magic != 0x11223344) {
-                printk(__FUNCTION__ ": bad magic for type\n");
+                CERROR("bad magic for type\n");
                 EXIT;
                 return -EINVAL;
         }
@@ -735,15 +736,14 @@ int obd_unregister_type(char *nm)
 
         if ( !type ) {
                 MOD_DEC_USE_COUNT;
-                printk(KERN_INFO __FUNCTION__ ": unknown obd type\n");
+                CERROR("unknown obd type\n");
                 EXIT;
                 return -EINVAL;
         }
 
         if ( type->typ_refcnt ) {
                 MOD_DEC_USE_COUNT;
-                printk(KERN_ALERT __FUNCTION__ ":type %s has refcount "
-                       "(%d)\n", nm, type->typ_refcnt);
+                CERROR("type %s has refcount (%d)\n", nm, type->typ_refcnt);
                 EXIT;
                 return -EBUSY;
         }
@@ -779,8 +779,7 @@ int init_obd(void)
         INIT_LIST_HEAD(&obd_types);
         
        if ( (err = misc_register(&obd_psdev)) ) { 
-                printk(KERN_ERR __FUNCTION__ ": cannot register %d err %d\n", 
-                       OBD_MINOR, err);
+                CERROR("cannot register %d err %d\n", OBD_MINOR, err);
                 return -EIO;
         }
 
index 9db8901..8140b52 100644 (file)
@@ -52,11 +52,9 @@ void obd_cleanup_obdo_cache(void)
         if (obdo_cachep != NULL) {
                 CDEBUG(D_CACHE, "destroying obdo_cache at %p\n", obdo_cachep);
                 if (kmem_cache_destroy(obdo_cachep))
-                        printk(KERN_WARNING __FUNCTION__
-                               ": unable to free cache\n");
+                        CERROR("unable to free cache\n");
         } else
-                printk(KERN_INFO __FUNCTION__
-                       ": called with NULL cache pointer\n");
+                CERROR("called with NULL cache pointer\n");
 
         obdo_cachep = NULL;
         EXIT;
@@ -89,8 +87,7 @@ int gen_connect (struct obd_conn *conn)
 
         OBD_ALLOC(cli, sizeof(struct obd_client));
         if ( !cli ) {
-                printk(__FUNCTION__ ": no memory! (minor %d)\n", 
-                       conn->oc_dev->obd_minor);
+                CERROR("no memory! (minor %d)\n", conn->oc_dev->obd_minor);
                 return -ENOMEM;
         }
 
@@ -192,8 +189,7 @@ int gen_multi_cleanup(struct obd_device *obddev)
                 rc  = OBP(ch_conn->oc_dev, disconnect)(ch_conn);
 
                 if ( rc != 0 ) {
-                        printk(KERN_WARNING __FUNCTION__
-                               ": disconnect failure %d\n",
+                        CERROR("disconnect failure %d\n",
                                ch_conn->oc_dev->obd_minor);
                 }
         }               
index 4ada516..58af539 100644 (file)
@@ -66,7 +66,7 @@ proc_lustre_mkdir(const char* dname, struct proc_dir_entry *parent)
                                            &proc_root);
 #endif
        if (!child_dir_entry)
-               printk ("lustre: failed to create /proc  entry %s\n", dname);
+                CERROR("lustre: failed to create /proc entry %s\n", dname);
        
        return child_dir_entry;
 }
index 575cc61..1777298 100644 (file)
@@ -104,7 +104,7 @@ int obd_sctl_vars (ctl_table * table, int write,
                 return rc;
 
         if ( index < 0 || index > 1 ) {
-                printk(KERN_WARNING __FUNCTION__ "Illegal index %d!\n", index);
+                CERROR("Illegal index %d!\n", index);
                 index = 0;
         } else {
                 obd_table[OBD_VARS_SLOT].data = &vars[index];
index 4be0175..7e8cf22 100644 (file)
@@ -145,7 +145,7 @@ static void filter_prep(struct obd_device *obddev)
        rc = simple_mkdir(current->fs->pwd, "D", 0700);
        file  = filp_open("O", O_RDONLY, 0); 
        if (!file || IS_ERR(file)) { 
-               printk(__FUNCTION__ ": cannot open O\n"); 
+               CERROR("cannot open O\n"); 
                goto out;
        }
        rc = simple_mkdir(file->f_dentry, "R", 0700);  /* regular */
@@ -160,7 +160,7 @@ static void filter_prep(struct obd_device *obddev)
        filter_id(rootid, FILTER_ROOTINO, S_IFDIR);
        file = filp_open(rootid, O_RDWR | O_CREAT, 00755);
        if (IS_ERR(file)) {
-               printk("OBD filter: cannot make root directory"); 
+               CERROR("OBD filter: cannot make root directory"); 
                goto out;
        }
        filp_close(file, 0);
@@ -168,7 +168,7 @@ static void filter_prep(struct obd_device *obddev)
 
        file = filp_open("D/status", O_RDWR | O_CREAT, 0700);
        if ( !file || IS_ERR(file) ) {
-               printk("OBD filter: cannot open/create status file\n");
+               CERROR("OBD filter: cannot open/create status file\n");
                goto out;
        }
 
@@ -183,14 +183,14 @@ static void filter_prep(struct obd_device *obddev)
                rc = file->f_op->write(file, (char *)&lastino, 
                                       sizeof(lastino), &off);
                if (rc != sizeof(lastino)) { 
-                       printk("OBD filter: error writing lastino\n");
+                       CERROR("OBD filter: error writing lastino\n");
                        goto out;
                }
        } else { 
                rc = file->f_op->read(file, (char *)&lastino, sizeof(lastino), 
                                      &off);
                if (rc != sizeof(lastino)) { 
-                       printk("OBD filter: error reading lastino\n");
+                       CERROR("OBD filter: error reading lastino\n");
                        goto out;
                }
        }
@@ -210,18 +210,18 @@ static void filter_post(struct obd_device *obddev)
        push_ctxt(&saved, &obddev->u.filter.fo_ctxt);
        file = filp_open("D/status", O_RDWR | O_CREAT, 0700);
        if ( !file || IS_ERR(file)) { 
-               printk("OBD filter: cannot create status file\n");
+               CERROR("OBD filter: cannot create status file\n");
                goto out;
        }
        rc = file->f_op->write(file, (char *)&obddev->u.filter.fo_lastino, 
                       sizeof(obddev->u.filter.fo_lastino), &off);
        if (rc != sizeof(sizeof(obddev->u.filter.fo_lastino)) ) { 
-               printk("OBD filter: error writing lastino\n");
+               CERROR("OBD filter: error writing lastino\n");
        }
 
        rc = filp_close(file, NULL); 
        if (rc) { 
-               printk("OBD filter: cannot close status file\n");
+               CERROR("OBD filter: cannot close status file\n");
        }
  out:
        pop_ctxt(&saved);
@@ -297,7 +297,7 @@ static int filter_cleanup(struct obd_device * obddev)
         }
 
         if ( !list_empty(&obddev->obd_gen_clients) ) {
-                printk(KERN_WARNING __FUNCTION__ ": still has clients!\n");
+                CERROR("still has clients!\n");
                 EXIT;
                 return -EBUSY;
         }
@@ -345,7 +345,7 @@ static struct file *filter_obj_open(struct obd_device *obddev,
         }
 
        if ( ! (oa->o_mode & S_IFMT) ) { 
-               printk("OBD filter_obj_open, no type (%Ld), mode %o!\n", 
+               CERROR("OBD filter_obj_open, no type (%Ld), mode %o!\n", 
                       oa->o_id, oa->o_mode);
        }
        filter_id(id, oa->o_id, oa->o_mode); 
@@ -370,7 +370,7 @@ static struct inode *filter_inode_from_obdo(struct obd_device *obddev,
 
        file = filter_obj_open(obddev, oa);
        if ( !file ) { 
-               printk("filter_inode_from_obdo failed\n"); 
+               CERROR("filter_inode_from_obdo failed\n"); 
                return NULL;
        }
 
@@ -495,7 +495,7 @@ static int filter_create (struct obd_conn* conn, struct obdo *oa)
 
        oa->o_id = filter_next_id(conn->oc_dev);
        if ( !(oa->o_mode && S_IFMT) ) { 
-               printk("filter obd: no type!\n");
+               CERROR("filter obd: no type!\n");
                return -ENOENT;
        }
 
@@ -507,7 +507,7 @@ static int filter_create (struct obd_conn* conn, struct obdo *oa)
        file = filp_open(name, O_RDONLY | O_CREAT, mode);
        pop_ctxt(&saved);
        if (IS_ERR(file)) { 
-               printk("Error mknod obj %s, err %ld\n", name, PTR_ERR(file));
+               CERROR("Error mknod obj %s, err %ld\n", name, PTR_ERR(file));
                return -ENOENT;
        }
        filp_close(file, 0);
index 760026d..b89abcb 100644 (file)
@@ -127,7 +127,7 @@ out:
        /* Too bad, we had an error */
 
 Ebadsize:
-       printk("ext2_check_page"
+       CERROR("ext2_check_page"
                "size of directory #%lu is not a multiple of chunk size",
                dir->i_ino
        );
@@ -147,7 +147,7 @@ Espan:
        //Einumber:
        // error = "inode out of bounds";
 bad_entry:
-       printk("ext2_check_page" "bad entry in directory #%lu: %s - "
+       CERROR("ext2_check_page" "bad entry in directory #%lu: %s - "
                "offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
                dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
                (unsigned long) le32_to_cpu(p->inode),
@@ -155,7 +155,7 @@ bad_entry:
        goto fail;
 Eend:
        p = (ext2_dirent *)(kaddr + offs);
-       printk("ext2_check_page"
+       CERROR("ext2_check_page"
                "entry in directory #%lu spans the page boundary"
                "offset=%lu, inode=%lu",
                dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
@@ -452,7 +452,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
                        name_len = EXT2_DIR_REC_LEN(de->name_len);
                        rec_len = le16_to_cpu(de->rec_len);
                        if ( n==npages && rec_len == 0) {
-                               printk("Fatal dir behaviour\n");
+                               CERROR("Fatal dir behaviour\n");
                                goto out_page;
                        }
                        if (!de->inode && rec_len >= reclen)
index a360c3a..b8e3387 100644 (file)
@@ -102,7 +102,7 @@ static struct dentry *obdfs_lookup(struct inode * dir, struct dentry *dentry)
         oa = obdo_fromid(IID(dir), ino, type, 
                         OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS);
         if ( IS_ERR(oa) ) {
-                printk(__FUNCTION__ ": obdo_fromid failed\n");
+                CERROR("obdo_fromid failed\n");
                 EXIT;
                 return ERR_PTR(-EACCES); 
         }
@@ -156,7 +156,7 @@ static struct inode *obdfs_new_inode(struct inode *dir, int mode)
        CDEBUG(D_INODE, "\n");
 
         if ( err ) {
-                printk("new_inode - fatal: err %d\n", err);
+                CERROR("new_inode - fatal: err %d\n", err);
                 obdo_free(oa);
                 EXIT;
                 return ERR_PTR(err);
@@ -167,7 +167,7 @@ static struct inode *obdfs_new_inode(struct inode *dir, int mode)
        CDEBUG(D_INODE, "\n");
 
         if (!inode) {
-                printk("new_inode -fatal:  %ld\n", (long)oa->o_id);
+                CERROR("new_inode -fatal:  %ld\n", (long)oa->o_id);
                 obd_destroy(IID(dir), oa);
                obdo_free(oa);
                 EXIT;
@@ -176,7 +176,7 @@ static struct inode *obdfs_new_inode(struct inode *dir, int mode)
         obdo_free(oa);
 
         if (!list_empty(&inode->i_dentry)) {
-                printk("new_inode -fatal: aliases %ld, ct %d lnk %d\n", 
+                CERROR("new_inode -fatal: aliases %ld, ct %d lnk %d\n", 
                       (long)oa->o_id,
                       atomic_read(&inode->i_count), 
                       inode->i_nlink);
index 5b04775..e884709 100644 (file)
@@ -225,7 +225,7 @@ int obdfs_writepage(struct page *page)
        int rc;
        struct inode *inode = page->mapping->host;
         ENTRY;
-       printk("---> writepage called ino %ld!\n", inode->i_ino);
+       CERROR("---> writepage called ino %ld!\n", inode->i_ino);
        BUG();
        rc = obdfs_brw(OBD_BRW_WRITE, inode, page, 1);
        if ( !rc ) {
@@ -361,11 +361,10 @@ void obdfs_cleanup_pgrqcache(void)
                 CDEBUG(D_CACHE, "destroying obdfs_pgrqcache at %p, count %ld\n",
                        obdfs_pgrq_cachep, obdfs_cache_count);
                 if (kmem_cache_destroy(obdfs_pgrq_cachep))
-                        printk(KERN_INFO __FUNCTION__
-                               ": unable to free all of cache\n");
+                        CERROR("unable to free all of cache\n");
                 obdfs_pgrq_cachep = NULL;
         } else
-                printk(KERN_INFO __FUNCTION__ ": called with NULL pointer\n");
+                CERROR("called with NULL pointer\n");
 
         EXIT;
 } /* obdfs_cleanup_wreqcache */
@@ -499,7 +498,7 @@ static int obdfs_add_page_to_cache(struct inode *inode, struct page *page)
                 obd_down(&obdfs_i2sbi(inode)->osi_list_mutex);
                 list_add(&pgrq->rq_plist, obdfs_iplist(inode));
                 obdfs_cache_count++;
-               //printk("-- count %d\n", obdfs_cache_count);
+               //CERROR("-- count %d\n", obdfs_cache_count);
 
                 /* If inode isn't already on superblock inodes list, add it.
                  *
@@ -532,9 +531,9 @@ static int obdfs_add_page_to_cache(struct inode *inode, struct page *page)
 void rebalance(void)
 {
        if (obdfs_cache_count > 60000) {
-               printk("-- count %ld\n", obdfs_cache_count);
+               CERROR("-- count %ld\n", obdfs_cache_count);
                //obdfs_flush_dirty_pages(~0UL);
-               printk("-- count %ld\n", obdfs_cache_count);
+               CERROR("-- count %ld\n", obdfs_cache_count);
        }
 }
 
@@ -659,7 +658,7 @@ struct page *obdfs_getpage(struct inode *inode, unsigned long offset,
 
         /* Yuck, no page */
         if (! page) {
-            printk(KERN_WARNING " grab_cache_page says no dice ...\n");
+            CERROR("grab_cache_page says no dice ...\n");
             EXIT;
             return NULL;
         }
@@ -671,8 +670,7 @@ struct page *obdfs_getpage(struct inode *inode, unsigned long offset,
                         if (PageLocked(page))
                                 obd_unlock_page(page);
                 } else {
-                        printk("file %s, line %d: expecting locked page\n",
-                               __FILE__, __LINE__); 
+                        CERROR("expecting locked page\n");
                 }
                 EXIT;
                 return page;
@@ -706,7 +704,7 @@ void obdfs_truncate(struct inode *inode)
         oa = obdo_alloc();
         if ( !oa ) {
                err = -ENOMEM;
-                printk(__FUNCTION__ ": obdo_alloc failed!\n");
+                CERROR("obdo_alloc failed!\n");
         } else {
                 oa->o_valid = OBD_MD_FLNOTOBD;
                 obdfs_from_inode(oa, inode);
@@ -719,7 +717,7 @@ void obdfs_truncate(struct inode *inode)
         }
 
         if (err) {
-                printk(__FUNCTION__ ": obd_truncate fails (%d)\n", err);
+                CERROR("obd_truncate fails (%d)\n", err);
                 EXIT;
                 return;
         }
index aa787c2..19d50a2 100644 (file)
@@ -60,7 +60,7 @@ static char *obdfs_read_opt(const char *opt, char *data)
         value++;
         OBD_ALLOC(retval, strlen(value) + 1);
         if ( !retval ) {
-                printk(KERN_ALERT __FUNCTION__ ": out of memory!\n");
+                CERROR("out of memory!\n");
                 return NULL;
         }
         
@@ -113,7 +113,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
         CDEBUG(D_INFO, "\n"); 
         obdfs_options(data, &device, &version);
         if ( !device ) {
-                printk(__FUNCTION__ ": no device\n");
+                CERROR("no device\n");
                 EXIT;
                 goto ERR;
         }
@@ -121,7 +121,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
        devno = simple_strtoul(device, NULL, 0);
         CDEBUG(D_INFO, "\n"); 
         if ( devno >= MAX_OBD_DEVICES ) {
-                printk(__FUNCTION__ ": device of %s too high (%d)\n", device, devno);
+                CERROR("device of %s too high (%d)\n", device, devno);
                 EXIT;
                 goto ERR;
         } 
@@ -134,7 +134,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
 
         err = obd_connect(&sbi->osi_conn);
         if ( err ) {
-                printk("OBDFS: cannot connect to %s\n", device);
+                CERROR("OBDFS: cannot connect to %s\n", device);
                 EXIT;
                 goto ERR;
         }
@@ -153,7 +153,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
                             "blocksize", &scratch,
                             (void *)&blocksize);
         if ( err ) {
-                printk("getinfo call to drive failed (blocksize)\n");
+                CERROR("getinfo call to drive failed (blocksize)\n");
                 EXIT;
                 goto ERR;
         }
@@ -163,7 +163,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
                           "blocksize_bits", &scratch,
                           (void *)&blocksize_bits);
         if ( err ) {
-                printk("getinfo call to drive failed (blocksize_bits)\n");
+                CERROR("getinfo call to drive failed (blocksize_bits)\n");
                 EXIT;
                 goto ERR;
         }
@@ -172,14 +172,14 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
         err = obd_get_info(&sbi->osi_conn, strlen("root_ino"), 
                           "root_ino", &scratch, (void *)&root_ino);
         if ( err ) {
-                printk("getinfo call to drive failed (root_ino)\n");
+                CERROR("getinfo call to drive failed (root_ino)\n");
                 EXIT;
                 goto ERR;
         }
         
         CDEBUG(D_INFO, "\n"); 
        sb->s_maxbytes = 1LL << 36;
-       printk("Max bytes: %Lx\n", sb->s_maxbytes);
+       CERROR("Max bytes: %Lx\n", sb->s_maxbytes);
         sb->s_blocksize = PAGE_SIZE;
         sb->s_blocksize_bits = (unsigned char)PAGE_SHIFT;
         sb->s_magic = OBDFS_SUPER_MAGIC;
@@ -193,7 +193,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
                          OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS);
         CDEBUG(D_INFO, "mode %o\n", oa->o_mode); 
         if ( IS_ERR(oa) ) {
-                printk(__FUNCTION__ ": obdo_fromid failed\n");
+                CERROR("obdo_fromid failed\n");
                iput(root); 
                 EXIT;
                 goto ERR;
@@ -203,14 +203,14 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
        obdo_free(oa);
         CDEBUG(D_INFO, "\n"); 
         if (!root) {
-            printk("OBDFS: bad iget4 for root\n");
+            CERROR("OBDFS: bad iget4 for root\n");
             sb->s_dev = 0;
             err = -ENOENT;
             EXIT;
             goto ERR;
         } 
         
-        CDEBUG(D_INFO, "obdfs_read_super: sbdev %d, rootino: %ld, dev %s, "
+        CDEBUG(D_INFO, "sbdev %d, rootino: %ld, dev %s, "
                "minor: %d, blocksize: %ld, blocksize bits %ld\n", 
                sb->s_dev, root->i_ino, device, MINOR(devno), 
                blocksize, blocksize_bits);
@@ -255,7 +255,7 @@ static void obdfs_put_super(struct super_block *sb)
         obd_disconnect(ID(sb));
         list_del(&sbi->osi_list);
         
-        printk(KERN_INFO "OBDFS: Bye bye.\n");
+        CERROR("OBDFS: Bye bye.\n");
 
         MOD_DEC_USE_COUNT;
         EXIT;
@@ -270,7 +270,7 @@ void obdfs_do_change_inode(struct inode *inode, int valid)
         ENTRY;
         oa = obdo_alloc();
         if ( !oa ) {
-                printk(__FUNCTION__ ": obdo_alloc failed\n");
+                CERROR("obdo_alloc failed\n");
                 EXIT;
                 return;
         }
@@ -281,7 +281,7 @@ void obdfs_do_change_inode(struct inode *inode, int valid)
         err = obd_setattr(IID(inode), oa);
 
         if ( err )
-                printk(__FUNCTION__ ": obd_setattr fails (%d)\n", err);
+                CERROR("obd_setattr fails (%d)\n", err);
 
         EXIT;
         obdo_free(oa);
@@ -326,7 +326,7 @@ static void obdfs_delete_inode(struct inode *inode)
         ENTRY;
         oa = obdo_alloc();
         if ( !oa ) {
-                printk(__FUNCTION__ ": obdo_alloc failed\n");
+                CERROR("obdo_alloc failed\n");
                 EXIT;
                 return;
         }
@@ -334,13 +334,13 @@ static void obdfs_delete_inode(struct inode *inode)
         obdfs_from_inode(oa, inode);
 
        /* XXX how do we know that this inode is now clean? */
-       printk("delete_inode ------> link %d\n", inode->i_nlink);
+       CERROR("delete_inode ------> link %d\n", inode->i_nlink);
         ODEBUG(oa);
         err = obd_destroy(IID(inode), oa);
         obdo_free(oa);
         clear_inode(inode);
         if (err) {
-                printk(__FUNCTION__ ": obd_destroy fails (%d)\n", err);
+                CERROR("obd_destroy fails (%d)\n", err);
                 EXIT;
                 return;
         }
@@ -389,7 +389,7 @@ int obdfs_setattr(struct dentry *de, struct iattr *attr)
         ENTRY;
         oa = obdo_alloc();
         if ( !oa ) {
-                printk(__FUNCTION__ ": obdo_alloc failed\n");
+                CERROR("obdo_alloc failed\n");
                 return -ENOMEM;
         }
 
@@ -400,7 +400,7 @@ int obdfs_setattr(struct dentry *de, struct iattr *attr)
         err = obd_setattr(IID(inode), oa);
 
         if ( err )
-                printk(__FUNCTION__ ": obd_setattr fails (%d)\n", err);
+                CERROR("obd_setattr fails (%d)\n", err);
 
         EXIT;
         obdo_free(oa);
@@ -418,7 +418,7 @@ static int obdfs_statfs(struct super_block *sb, struct statfs *buf)
 
         err = obd_statfs(ID(sb), &tmp);
         if ( err ) { 
-                printk(__FUNCTION__ ": obd_statfs fails (%d)\n", err);
+                CERROR("obd_statfs fails (%d)\n", err);
                 return err;
         }
        memcpy(buf, &tmp, sizeof(*buf));
index b3a305f..8fefa77 100644 (file)
@@ -56,7 +56,7 @@ struct ptlrpc_request *ost_prep_req(int opcode, int buflen1, char *buf1,
 
        OBD_ALLOC(request, sizeof(*request));
        if (!request) { 
-               printk("osc_prep_req: request allocation out of memory\n");
+               CERROR("request allocation out of memory\n");
                return NULL;
        }
 
@@ -67,7 +67,7 @@ struct ptlrpc_request *ost_prep_req(int opcode, int buflen1, char *buf1,
                          &request->rq_reqhdr, &request->rq_req.ost, 
                          &request->rq_reqlen, &request->rq_reqbuf);
        if (rc) { 
-               printk("llight request: cannot pack request %d\n", rc); 
+               CERROR("llight request: cannot pack request %d\n", rc); 
                return NULL;
        }
        request->rq_reqhdr->opc = opcode;
@@ -100,8 +100,7 @@ extern int osc_queue_wait(struct obd_conn *conn, struct ptlrpc_request *req)
                rc = ptl_send_rpc(req, peer);
        }
        if (rc) { 
-               printk(__FUNCTION__ ": error %d, opcode %d\n", rc, 
-                      req->rq_reqhdr->opc); 
+               CERROR("error %d, opcode %d\n", rc, req->rq_reqhdr->opc); 
                return -rc;
        }
 
@@ -118,7 +117,7 @@ extern int osc_queue_wait(struct obd_conn *conn, struct ptlrpc_request *req)
        rc = ost_unpack_rep(req->rq_repbuf, req->rq_replen, &req->rq_rephdr, 
                            &req->rq_rep.ost); 
        if (rc) {
-               printk(__FUNCTION__ ": mds_unpack_rep failed: %d\n", rc);
+               CERROR("mds_unpack_rep failed: %d\n", rc);
                return rc;
        }
 
@@ -144,7 +143,7 @@ static int osc_connect(struct obd_conn *conn)
        
        request = ost_prep_req(OST_CONNECT, 0, NULL, 0, NULL);
        if (!request) { 
-               printk(__FUNCTION__ ": cannot pack req!\n"); 
+               CERROR("cannot pack req!\n"); 
                return -ENOMEM;
        }
 
@@ -174,7 +173,7 @@ static int osc_disconnect(struct obd_conn *conn)
        
        request = ost_prep_req(OST_DISCONNECT, 0, NULL, 0, NULL);
        if (!request) { 
-               printk(__FUNCTION__ ": cannot pack req!\n"); 
+               CERROR("cannot pack req!\n"); 
                return -ENOMEM;
        }
 
@@ -200,7 +199,7 @@ static int osc_getattr(struct obd_conn *conn, struct obdo *oa)
 
        request = ost_prep_req(OST_GETATTR, 0, NULL, 0, NULL);
        if (!request) { 
-               printk(__FUNCTION__ ": cannot pack req!\n"); 
+               CERROR("cannot pack req!\n"); 
                return -ENOMEM;
        }
        
@@ -232,7 +231,7 @@ static int osc_setattr(struct obd_conn *conn, struct obdo *oa)
 
        request = ost_prep_req(OST_SETATTR, 0, NULL, 0, NULL);
        if (!request) { 
-               printk(__FUNCTION__ ": cannot pack req!\n"); 
+               CERROR("cannot pack req!\n"); 
                return -ENOMEM;
        }
        
@@ -257,11 +256,11 @@ static int osc_create(struct obd_conn *conn, struct obdo *oa)
        int rc; 
 
        if (!oa) { 
-               printk(__FUNCTION__ ": oa NULL\n"); 
+               CERROR("oa NULL\n"); 
        }
        request = ost_prep_req(OST_CREATE, 0, NULL, 0, NULL);
        if (!request) { 
-               printk("osc_connect: cannot pack req!\n"); 
+               CERROR("cannot pack req!\n"); 
                return -ENOMEM;
        }
        
@@ -288,11 +287,11 @@ static int osc_destroy(struct obd_conn *conn, struct obdo *oa)
        int rc; 
 
        if (!oa) { 
-               printk(__FUNCTION__ ": oa NULL\n"); 
+               CERROR("oa NULL\n"); 
        }
        request = ost_prep_req(OST_DESTROY, 0, NULL, 0, NULL);
        if (!request) { 
-               printk("osc_connect: cannot pack req!\n"); 
+               CERROR("cannot pack req!\n"); 
                return -ENOMEM;
        }
        
@@ -327,11 +326,11 @@ static int osc_setup(struct obd_device *obddev, obd_count len,
                /* This is a local connection */
                osc->osc_tgt = &obd_dev[data->ioc_dev];
 
-               printk("OSC: tgt %d ost at %p\n", data->ioc_dev,
+               CERROR("OSC: tgt %d ost at %p\n", data->ioc_dev,
                       &osc->osc_tgt->u.ost);
                if ( ! (osc->osc_tgt->obd_flags & OBD_ATTACHED) || 
                     ! (osc->osc_tgt->obd_flags & OBD_SET_UP) ){
-                       printk("device not attached or not set up (%d)\n", 
+                       CERROR("device not attached or not set up (%d)\n", 
                               data->ioc_dev);
                        EXIT;
                        return -EINVAL;
@@ -343,7 +342,7 @@ static int osc_setup(struct obd_device *obddev, obd_count len,
                /* XXX: this should become something like ioc_inlbuf1 */
                err = kportal_uuid_to_peer("ost", &osc->osc_peer);
                if (err != 0) {
-                       printk("Cannot find 'ost' peer.\n");
+                       CERROR("Cannot find 'ost' peer.\n");
                        EXIT;
                        return -EINVAL;
                }
@@ -382,7 +381,7 @@ int osc_brw(int rw, struct obd_conn *conn, obd_count num_oa,
 
        request = ost_prep_req(OST_BRW, size1, NULL, size2, NULL);
        if (!request) { 
-               printk("osc_connect: cannot pack req!\n"); 
+               CERROR("cannot pack req!\n"); 
                return -ENOMEM;
        }
 
@@ -411,7 +410,7 @@ int osc_brw(int rw, struct obd_conn *conn, obd_count num_oa,
 #if 0
        ptr2 = ost_rep_buf2(request->rq_rep.ost); 
        if (request->rq_rep.ost->buflen2 != n * sizeof(struct niobuf)) { 
-               printk(__FUNCTION__ ": buffer length wrong\n"); 
+               CERROR("buffer length wrong\n"); 
                goto out;
        }
 
index f8c1317..cc41e31 100644 (file)
@@ -145,7 +145,7 @@ static int ost_destroy(struct ost_obd *ost, struct ptlrpc_request *req)
        rc = ost_pack_rep(NULL, 0, NULL, 0, &req->rq_rephdr, &req->rq_rep.ost,
                          &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_destroy: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
 
@@ -169,7 +169,7 @@ static int ost_getattr(struct ost_obd *ost, struct ptlrpc_request *req)
        rc = ost_pack_rep(NULL, 0, NULL, 0, &req->rq_rephdr, &req->rq_rep.ost,
                          &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_getattr: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
        req->rq_rep.ost->oa.o_id = req->rq_req.ost->oa.o_id;
@@ -195,7 +195,7 @@ static int ost_create(struct ost_obd *ost, struct ptlrpc_request *req)
        rc = ost_pack_rep(NULL, 0, NULL, 0, &req->rq_rephdr, &req->rq_rep.ost,
                          &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_create: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
 
@@ -222,7 +222,7 @@ static int ost_setattr(struct ost_obd *ost, struct ptlrpc_request *req)
        rc = ost_pack_rep(NULL, 0, NULL, 0, &req->rq_rephdr, &req->rq_rep.ost,
                          &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_setattr: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
 
@@ -248,13 +248,13 @@ static int ost_connect(struct ost_obd *ost, struct ptlrpc_request *req)
        rc = ost_pack_rep(NULL, 0, NULL, 0, &req->rq_rephdr, &req->rq_rep.ost,
                          &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_setattr: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
 
        req->rq_rep.ost->result =ost->ost_tgt->obd_type->typ_ops->o_connect(&conn);
 
-        CDEBUG(0, "ost_connect: rep buffer %p, id %d\n", req->rq_repbuf,
+        CDEBUG(0, "rep buffer %p, id %d\n", req->rq_repbuf,
               conn.oc_id);
        req->rq_rep.ost->connid = conn.oc_id;
        EXIT;
@@ -274,7 +274,7 @@ static int ost_disconnect(struct ost_obd *ost, struct ptlrpc_request *req)
        rc = ost_pack_rep(NULL, 0, NULL, 0, &req->rq_rephdr, &req->rq_rep.ost,
                          &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_setattr: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
 
@@ -301,10 +301,10 @@ static int ost_get_info(struct ost_obd *ost, struct ptlrpc_request *req)
        req->rq_rep.ost->result =ost->ost_tgt->obd_type->typ_ops->o_get_info
                (&conn, req->rq_req.ost->buflen1, ptr, &vallen, &val); 
 
-       rc = ost_pack_rep(val, vallen, NULL, 0, &req->rq_rephdr, &req->rq_rep.ost,
-                         &req->rq_replen, &req->rq_repbuf); 
+       rc = ost_pack_rep(val, vallen, NULL, 0, &req->rq_rephdr,
+                          &req->rq_rep.ost, &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_setattr: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
 
@@ -341,7 +341,7 @@ int ost_brw(struct ost_obd *obddev, struct ptlrpc_request *req)
                          &req->rq_rephdr, &req->rq_rep.ost,
                          &req->rq_replen, &req->rq_repbuf); 
        if (rc) { 
-               printk("ost_create: cannot pack reply\n"); 
+               CERROR("cannot pack reply\n"); 
                return rc;
        }
        res = ost_rep_buf1(req->rq_rep.ost); 
@@ -403,7 +403,7 @@ int ost_handle(struct obd_device *obddev, struct ptlrpc_request *req)
 
        hdr = (struct ptlreq_hdr *)req->rq_reqbuf;
        if (NTOH__u32(hdr->type) != OST_TYPE_REQ) {
-               printk("lustre_ost: wrong packet type sent %d\n",
+               CERROR("lustre_ost: wrong packet type sent %d\n",
                       NTOH__u32(hdr->type));
                rc = -EINVAL;
                goto out;
@@ -412,7 +412,7 @@ int ost_handle(struct obd_device *obddev, struct ptlrpc_request *req)
        rc = ost_unpack_req(req->rq_reqbuf, req->rq_reqlen, 
                            &req->rq_reqhdr, &req->rq_req.ost);
        if (rc) { 
-               printk("lustre_ost: Invalid request\n");
+               CERROR("lustre_ost: Invalid request\n");
                EXIT; 
                goto out;
        }
@@ -459,7 +459,7 @@ int ost_handle(struct obd_device *obddev, struct ptlrpc_request *req)
 out:
        req->rq_status = rc;
        if (rc) { 
-               printk("ost: processing error %d\n", rc);
+               CERROR("ost: processing error %d\n", rc);
                ost_error(obddev, req);
        } else { 
                CDEBUG(D_INODE, "sending reply\n"); 
@@ -556,7 +556,7 @@ int ost_main(void *arg)
 
        ost->ost_thread = NULL;
        wake_up(&ost->ost_done_waitq);
-       printk("lustre_ost: exiting\n");
+       CERROR("lustre_ost: exiting\n");
        return 0;
 }
 
@@ -605,7 +605,7 @@ static int ost_setup(struct obd_device *obddev, obd_count len,
        ost->ost_tgt = tgt;
         if ( ! (tgt->obd_flags & OBD_ATTACHED) || 
              ! (tgt->obd_flags & OBD_SET_UP) ){
-                printk("device not attached or not set up (%d)\n", 
+                CERROR("device not attached or not set up (%d)\n", 
                        data->ioc_dev);
                 EXIT;
                return -EINVAL;
@@ -614,7 +614,7 @@ static int ost_setup(struct obd_device *obddev, obd_count len,
        ost->ost_conn.oc_dev = tgt;
        err = tgt->obd_type->typ_ops->o_connect(&ost->ost_conn);
        if (err) { 
-               printk("lustre ost: fail to connect to device %d\n", 
+               CERROR("lustre ost: fail to connect to device %d\n", 
                       data->ioc_dev); 
                return -EINVAL;
        }
@@ -659,7 +659,7 @@ static int ost_cleanup(struct obd_device * obddev)
         }
 
         if ( !list_empty(&obddev->obd_gen_clients) ) {
-                printk(KERN_WARNING __FUNCTION__ ": still has clients!\n");
+                CERROR("still has clients!\n");
                 EXIT;
                 return -EBUSY;
         }
@@ -676,7 +676,7 @@ static int ost_cleanup(struct obd_device * obddev)
        tgt = ost->ost_tgt;
        err = tgt->obd_type->typ_ops->o_disconnect(&ost->ost_conn);
        if (err) { 
-               printk("lustre ost: fail to disconnect device\n");
+               CERROR("lustre ost: fail to disconnect device\n");
                return -EINVAL;
        }
        
index fe81f46..4742320 100644 (file)
@@ -60,7 +60,7 @@ static int incoming_callback(ptl_event_t *ev, void *data)
        int rc;
 
        if (ev->rlength != ev->mlength)
-               printk("Warning: Possibly truncated rpc (%d/%d)\n",
+               CERROR("Warning: Possibly truncated rpc (%d/%d)\n",
                        ev->mlength, ev->rlength);
 
        /* The ME is unlinked when there is less than 1024 bytes free
@@ -79,13 +79,13 @@ static int incoming_callback(ptl_event_t *ev, void *data)
        service->srv_ref_count[service->srv_md_active]++;
 
        if (ev->offset >= (service->srv_buf_size - 1024)) {
-               printk("Unlinking ME %d\n", service->srv_me_active);
+               CERROR("Unlinking ME %d\n", service->srv_me_active);
 
                rc = PtlMEUnlink(service->srv_me_h[service->srv_me_active]);
                service->srv_me_h[service->srv_me_active] = 0;
 
                if (rc != PTL_OK) {
-                       printk("PtlMEUnlink failed: %d\n", rc); 
+                       CERROR("PtlMEUnlink failed: %d\n", rc); 
                        return rc;
                }
 
@@ -93,7 +93,7 @@ static int incoming_callback(ptl_event_t *ev, void *data)
                        service->srv_ring_length);
 
                if (service->srv_me_h[service->srv_me_active] == 0)
-                       printk("All %d ring ME's are unlinked!\n",
+                       CERROR("All %d ring ME's are unlinked!\n",
                                service->srv_ring_length);
 
        }
@@ -101,7 +101,7 @@ static int incoming_callback(ptl_event_t *ev, void *data)
         if (ev->type == PTL_EVENT_PUT) {
                 wake_up(service->srv_wait_queue);
         } else {
-                printk("Unexpected event type: %d\n", ev->type);
+                CERROR("Unexpected event type: %d\n", ev->type);
         }
 
         return 0;
@@ -118,7 +118,7 @@ static int bulk_source_callback(ptl_event_t *ev, void *data)
         } else if (ev->type == PTL_EVENT_ACK) {
                 wake_up_interruptible(&rpc->rq_wait_for_bulk);
         } else {
-                printk("Unexpected event type in " __FUNCTION__ "!\n");
+                CERROR("Unexpected event type!\n");
         }
 
         EXIT;
@@ -133,10 +133,10 @@ static int bulk_sink_callback(ptl_event_t *ev, void *data)
 
         if (ev->type == PTL_EVENT_PUT) {
                 if (rpc->rq_bulkbuf != ev->mem_desc.start + ev->offset)
-                        printk(__FUNCTION__ ": bulkbuf != mem_desc -- why?\n");
+                        CERROR("bulkbuf != mem_desc -- why?\n");
                 wake_up_interruptible(&rpc->rq_wait_for_bulk);
         } else {
-                printk("Unexpected event type in " __FUNCTION__ "!\n");
+                CERROR("Unexpected event type!\n");
         }
 
         EXIT;
@@ -170,7 +170,7 @@ int ptl_send_buf(struct ptlrpc_request *request, struct lustre_peer *peer,
 
         rc = PtlMDBind(peer->peer_ni, request->rq_req_md, &md_h);
         if (rc != 0) {
-                printk(__FUNCTION__ ": PtlMDBind failed: %d\n", rc);
+                CERROR("PtlMDBind failed: %d\n", rc);
                 return rc;
         }
 
@@ -186,7 +186,7 @@ int ptl_send_buf(struct ptlrpc_request *request, struct lustre_peer *peer,
                             request->rq_xid, 0, 0);
         }
         if (rc != PTL_OK) {
-                printk(__FUNCTION__ ": PtlPut failed: %d\n", rc);
+                CERROR("PtlPut failed: %d\n", rc);
                 /* FIXME: tear down md */
         }
 
@@ -202,7 +202,7 @@ int ptl_send_rpc(struct ptlrpc_request *request, struct lustre_peer *peer)
         ENTRY;
 
         if (request->rq_replen == 0) {
-                printk(__FUNCTION__ ": request->rq_replen is 0!\n");
+                CERROR("request->rq_replen is 0!\n");
                 EXIT;
                 return -EINVAL;
         }
@@ -285,8 +285,7 @@ int ptl_received_rpc(struct ptlrpc_service *service) {
                CDEBUG(D_INFO, "Removing MD at index %d, rc %d\n", index, rc);
 
                 if (rc)
-                        printk(__FUNCTION__ 
-                               ": PtlMDUnlink failed: index %d rc %d\n", 
+                        CERROR(": PtlMDUnlink failed: index %d rc %d\n", 
                                index, rc);
 
                 /* Replace the unlinked ME and MD */
@@ -299,7 +298,7 @@ int ptl_received_rpc(struct ptlrpc_service *service) {
                 service->srv_ref_count[index] = 0;
                 
                if (rc != PTL_OK) {
-                        printk("PtlMEInsert failed: %d\n", rc);
+                        CERROR("PtlMEInsert failed: %d\n", rc);
                         return rc;
                 }
 
@@ -316,7 +315,7 @@ int ptl_received_rpc(struct ptlrpc_service *service) {
                CDEBUG(D_INFO, "Attach MD in ring, rc %d\n", rc);
                 if (rc != PTL_OK) {
                         /* cleanup */
-                        printk("PtlMDAttach failed: %d\n", rc);
+                        CERROR("PtlMDAttach failed: %d\n", rc);
                         return rc;
                 }
 
@@ -334,7 +333,7 @@ int rpc_register_service(struct ptlrpc_service *service, char *uuid)
 
         rc = kportal_uuid_to_peer(uuid, &peer);
         if (rc != 0) {
-                printk("Invalid uuid \"%s\"\n", uuid);
+                CERROR("Invalid uuid \"%s\"\n", uuid);
                 return -EINVAL;
         }
 
@@ -350,7 +349,7 @@ int rpc_register_service(struct ptlrpc_service *service, char *uuid)
                 service, &(service->srv_eq_h));
 
         if (rc != PTL_OK) {
-                printk("PtlEQAlloc failed: %d\n", rc);
+                CERROR("PtlEQAlloc failed: %d\n", rc);
                 return rc;
         }
 
@@ -360,7 +359,7 @@ int rpc_register_service(struct ptlrpc_service *service, char *uuid)
                 &(service->srv_me_h[0]));
 
         if (rc != PTL_OK) {
-                printk("PtlMEAttach failed: %d\n", rc);
+                CERROR("PtlMEAttach failed: %d\n", rc);
                 return rc;
         }
 
@@ -368,7 +367,7 @@ int rpc_register_service(struct ptlrpc_service *service, char *uuid)
                OBD_ALLOC(service->srv_buf[i], service->srv_buf_size);                
 
                 if (service->srv_buf[i] == NULL) {
-                        printk(__FUNCTION__ ": no memory\n");
+                        CERROR("no memory\n");
                         return -ENOMEM;
                 }
 
@@ -380,7 +379,7 @@ int rpc_register_service(struct ptlrpc_service *service, char *uuid)
                        service->srv_me_tail = i;
 
                        if (rc != PTL_OK) {
-                               printk("PtlMEInsert failed: %d\n", rc);
+                               CERROR("PtlMEInsert failed: %d\n", rc);
                                return rc;
                        }
                }
@@ -398,7 +397,7 @@ int rpc_register_service(struct ptlrpc_service *service, char *uuid)
 
                 if (rc != PTL_OK) {
                         /* cleanup */
-                        printk("PtlMDAttach failed: %d\n", rc);
+                        CERROR("PtlMDAttach failed: %d\n", rc);
                         return rc;
                 }
        }
@@ -413,18 +412,18 @@ int rpc_unregister_service(struct ptlrpc_service *service)
        for (i = 0; i < service->srv_ring_length; i++) {
                rc = PtlMDUnlink(service->srv_md_h[i]);
                if (rc)
-                       printk(__FUNCTION__ ": PtlMDUnlink failed: %d\n", rc);
+                       CERROR("PtlMDUnlink failed: %d\n", rc);
        
                rc = PtlMEUnlink(service->srv_me_h[i]);
                if (rc)
-                       printk(__FUNCTION__ ": PtlMEUnlink failed: %d\n", rc);
+                       CERROR("PtlMEUnlink failed: %d\n", rc);
        
                OBD_FREE(service->srv_buf[i], service->srv_buf_size);           
        }
 
         rc = PtlEQFree(service->srv_eq_h);
         if (rc)
-                printk(__FUNCTION__ ": PtlEQFree failed: %d\n", rc);
+                CERROR("PtlEQFree failed: %d\n", rc);
 
         return 0;
 }
@@ -437,22 +436,22 @@ static int req_init_portals(void)
 
         nip = inter_module_get_request(LUSTRE_NAL "_ni", LUSTRE_NAL);
         if (nip == NULL) {
-                printk("get_ni failed: is the NAL module loaded?\n");
+                CERROR("get_ni failed: is the NAL module loaded?\n");
                 return -EIO;
         }
         ni = *nip;
 
         rc = PtlEQAlloc(ni, 128, request_callback, NULL, &req_eq);
         if (rc != PTL_OK)
-                printk("PtlEQAlloc failed: %d\n", rc);
+                CERROR("PtlEQAlloc failed: %d\n", rc);
 
         rc = PtlEQAlloc(ni, 128, bulk_source_callback, NULL, &bulk_source_eq);
         if (rc != PTL_OK)
-                printk("PtlEQAlloc failed: %d\n", rc);
+                CERROR("PtlEQAlloc failed: %d\n", rc);
 
         rc = PtlEQAlloc(ni, 128, bulk_sink_callback, NULL, &bulk_sink_eq);
         if (rc != PTL_OK)
-                printk("PtlEQAlloc failed: %d\n", rc);
+                CERROR("PtlEQAlloc failed: %d\n", rc);
 
         return rc;
 }