Whamcloud - gitweb
64-bit warning fixes. Someone should take a closer look at ext2_obd.c
authorpschwan <pschwan>
Mon, 22 Apr 2002 22:06:42 +0000 (22:06 +0000)
committerpschwan <pschwan>
Mon, 22 Apr 2002 22:06:42 +0000 (22:06 +0000)
20 files changed:
lustre/include/linux/lustre_mds.h
lustre/include/linux/obd_class.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c
lustre/llite/file.c
lustre/llite/namei.c
lustre/llite/rw.c
lustre/llite/super.c
lustre/mdc/mdc_request.c
lustre/mds/handler.c
lustre/obdclass/genops.c
lustre/obdecho/echo.c
lustre/obdfilter/filter.c
lustre/obdfs/file.c
lustre/obdfs/namei.c
lustre/obdfs/rw.c
lustre/obdfs/super.c
lustre/osc/osc_request.c
lustre/ptlrpc/service.c

index 8e017f4..31cd39e 100644 (file)
@@ -107,7 +107,7 @@ struct dentry *mds_fid2dentry(struct mds_obd *mds, struct ll_fid *fid, struct vf
 int mdc_connect(struct ptlrpc_client *, struct ptlrpc_connection *, 
                 struct ll_fid *rootfid, struct ptlrpc_request **);
 int mdc_getattr(struct ptlrpc_client *, struct ptlrpc_connection *, ino_t ino,
-                int type, int valid, struct ptlrpc_request **);
+                int type, unsigned long valid, struct ptlrpc_request **);
 int mdc_setattr(struct ptlrpc_client *, struct ptlrpc_connection *,
                 struct inode *, struct iattr *iattr, struct ptlrpc_request **);
 int mdc_open(struct ptlrpc_client *, struct ptlrpc_connection *, ino_t ino,
index 1ce67bd..ea1cfd1 100644 (file)
@@ -577,7 +577,8 @@ static __inline__ void obdo_cpy_md(struct obdo *dst, struct obdo *src)
 {
 #ifdef __KERNEL__
         CDEBUG(D_INODE, "src obdo %Ld valid 0x%x, dst obdo %Ld\n",
-               src->o_id, src->o_valid, dst->o_id);
+               (unsigned long long)src->o_id, src->o_valid,
+               (unsigned long long)dst->o_id);
 #endif
         if ( src->o_valid & OBD_MD_FLATIME ) 
                 dst->o_atime = src->o_atime;
index b8208d4..83e2d2c 100644 (file)
@@ -314,5 +314,6 @@ void ldlm_lock_dump(struct ldlm_lock *lock)
                (int)lock->l_req_mode, (int)lock->l_granted_mode);
         if (lock->l_resource->lr_type == LDLM_EXTENT)
                 CDEBUG(D_OTHER, "  Extent: %Lu -> %Lu\n",
-                       lock->l_extent.start, lock->l_extent.end);
+                       (unsigned long long)lock->l_extent.start,
+                       (unsigned long long)lock->l_extent.end);
 }
index ac23beb..7c5aa44 100644 (file)
@@ -103,8 +103,9 @@ int ldlm_cli_enqueue(struct ptlrpc_client *cl, struct ptlrpc_connection *conn,
 
         CERROR("remote handle: %p, flags: %d\n",
                (void *)(unsigned long)reply->lock_handle.addr, *flags);
-        CERROR("extent: %Lu -> %Lu\n", reply->lock_extent.start,
-               reply->lock_extent.end);
+        CERROR("extent: %Lu -> %Lu\n",
+               (unsigned long long)reply->lock_extent.start,
+               (unsigned long long)reply->lock_extent.end);
 
         EXIT;
  local:
index b97f546..90fbfa7 100644 (file)
@@ -263,7 +263,9 @@ void ldlm_resource_dump(struct ldlm_resource *res)
                 LBUG();
 
         snprintf(name, sizeof(name), "%Lx %Lx %Lx",
-                 res->lr_name[0], res->lr_name[1], res->lr_name[2]);
+                 (unsigned long long)res->lr_name[0],
+                 (unsigned long long)res->lr_name[1],
+                 (unsigned long long)res->lr_name[2]);
 
         CDEBUG(D_OTHER, "--- Resource: %p (%s)\n", res, name);
         CDEBUG(D_OTHER, "Namespace: %p (%u)\n", res->lr_namespace,
index 8073b49..b41e50c 100644 (file)
@@ -176,11 +176,11 @@ static ssize_t
 ll_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
         ssize_t retval;
-        CDEBUG(D_INFO, "Writing inode %ld, %d bytes, offset %Ld\n",
-               file->f_dentry->d_inode->i_ino, count, *ppos);
+        CDEBUG(D_INFO, "Writing inode %ld, %ld bytes, offset %Ld\n",
+               file->f_dentry->d_inode->i_ino, (long)count, *ppos);
 
         retval = generic_file_write(file, buf, count, ppos);
-        CDEBUG(D_INFO, "Wrote %d\n", retval);
+        CDEBUG(D_INFO, "Wrote %ld\n", (long)retval);
 
         /* update mtime/ctime/atime here, NOT size */
         if (retval > 0) {
index f5a1e33..27650f8 100644 (file)
@@ -110,7 +110,7 @@ static struct dentry *ll_lookup(struct inode * dir, struct dentry *dentry)
         err = mdc_getattr(&sbi->ll_mds_client, sbi->ll_mds_conn, ino, type,
                           OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, &request);
         if (err) {
-                CERROR("failure %d inode %ld\n", err, ino);
+                CERROR("failure %d inode %ld\n", err, (long)ino);
                 ptlrpc_free_req(request);
                 RETURN(ERR_PTR(-abs(err)));
         }
@@ -149,14 +149,14 @@ static struct inode *ll_create_node(struct inode *dir, const char *name,
                 GOTO(out, err);
         }
         body = lustre_msg_buf(request->rq_repmsg, 0);
-        body->valid = OBD_MD_FLNOTOBD;
+        body->valid = (__u32)OBD_MD_FLNOTOBD;
 
         body->objid = id; 
         body->nlink = 1;
         body->atime = body->ctime = body->mtime = time;
         body->mode = mode;
         CDEBUG(D_INODE, "-- new_inode: objid %lld, ino %d, mode %o\n",
-               body->objid, body->ino, body->mode); 
+               (unsigned long long)body->objid, body->ino, body->mode); 
 
         inode = iget4(dir->i_sb, body->ino, ll_find_inode, body);
         if (IS_ERR(inode)) {
@@ -254,13 +254,12 @@ static int ll_create (struct inode * dir, struct dentry * dentry, int mode)
         oa.o_mode = S_IFREG | 0600;
         err = obd_create(ll_i2obdconn(dir), &oa);  
         if (err) { 
-                EXIT; 
-                return err;
+                RETURN(err);
         }
 
         mode = mode | S_IFREG;
-        CDEBUG(D_DENTRY, "name %s mode %o o_id %lld\n", 
-               dentry->d_name.name, mode, oa.o_id);
+        CDEBUG(D_DENTRY, "name %s mode %o o_id %lld\n",
+               dentry->d_name.name, mode, (unsigned long long)oa.o_id);
         inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len, 
                                NULL, 0, mode, oa.o_id);
         err = PTR_ERR(inode);
@@ -271,8 +270,7 @@ static int ll_create (struct inode * dir, struct dentry * dentry, int mode)
                 inode->i_mapping->a_ops = &ll_aops;
                 err = ext2_add_nondir(dentry, inode);
         }
-        EXIT;
-        return err;
+        RETURN(err);
 } /* ll_create */
 
 
index 69ccf4c..4e9d655 100644 (file)
@@ -77,7 +77,7 @@ void set_page_dirty(struct page *page)
 }
 #endif
 
-inline struct obdo * ll_oa_from_inode(struct inode *inode, int valid)
+inline struct obdo * ll_oa_from_inode(struct inode *inode, unsigned long valid)
 {
         struct ll_inode_info *oinfo = ll_i2info(inode);
         struct obdo *oa = obdo_alloc();
@@ -301,7 +301,7 @@ static int ll_commit_write(struct file *file, struct page *page,
                 LBUG();
 
         CDEBUG(D_INODE, "commit_page writing (at %d) to %d, count %Ld\n", 
-               from, to, count);
+               from, to, (unsigned long long)count);
 
         err = obd_brw(OBD_BRW_WRITE, ll_i2obdconn(inode), num_obdo, &oa,
                       &bufs_per_obdo, &page, &count, &offset, &flags);
@@ -338,7 +338,7 @@ void ll_truncate(struct inode *inode)
         } 
         
         CDEBUG(D_INFO, "calling punch for %ld (%Lu bytes at 0)\n",
-               (long)oa->o_id, oa->o_size);
+               (long)oa->o_id, (unsigned long long)oa->o_size);
         err = obd_punch(ll_i2obdconn(inode), oa, oa->o_size, 0);
         obdo_free(oa);
 
index 148c096..dd426b4 100644 (file)
@@ -143,7 +143,7 @@ static struct super_block * ll_read_super(struct super_block *sb,
         }
         sbi->ll_rootino = rootfid.id;
 
-        sb->s_maxbytes = 1LL << 36;
+        sb->s_maxbytes = 1ULL << 36;
         sb->s_blocksize = PAGE_SIZE;
         sb->s_blocksize_bits = (unsigned char)PAGE_SHIFT;
         sb->s_magic = LL_SUPER_MAGIC;
@@ -222,7 +222,7 @@ static void ll_delete_inode(struct inode *inode)
 
                 err = obd_destroy(ll_i2obdconn(inode), oa); 
                 CDEBUG(D_INODE, "obd destroy of %Ld error %d\n",
-                       oa->o_id, err);
+                       (unsigned long long)oa->o_id, err);
                 obdo_free(oa);
         }
 
index 2b0cd5f..b292bee 100644 (file)
@@ -70,7 +70,8 @@ int mdc_connect(struct ptlrpc_client *cl, struct ptlrpc_connection *conn,
 
 
 int mdc_getattr(struct ptlrpc_client *cl, struct ptlrpc_connection *conn,
-                ino_t ino, int type, int valid, struct ptlrpc_request **request)
+                ino_t ino, int type, unsigned long valid,
+                struct ptlrpc_request **request)
 {
         struct ptlrpc_request *req;
         struct mds_body *body;
@@ -174,7 +175,7 @@ int mdc_readpage(struct ptlrpc_client *cl, struct ptlrpc_connection *conn,
 
         niobuf.addr = (__u64) (long) addr;
 
-        CDEBUG(D_INODE, "inode: %ld\n", ino);
+        CDEBUG(D_INODE, "inode: %ld\n", (long)ino);
 
         bulk = ptlrpc_prep_bulk(conn);
         if (bulk == NULL) {
@@ -311,11 +312,12 @@ static int request_ioctl(struct inode *inode, struct file *file,
         case IOC_REQUEST_OPEN: {
                 __u64 fh, ino;
                 copy_from_user(&ino, (__u64 *)arg, sizeof(ino));
-                CERROR("-- opening ino %llu\n", ino);
+                CERROR("-- opening ino %llu\n", (unsigned long long)ino);
                 err = mdc_open(&cl, conn, ino, S_IFDIR, O_RDONLY, &fh,
                                &request);
                 copy_to_user((__u64 *)arg, &fh, sizeof(fh));
-                CERROR("-- done err %d (fh=%Lu)\n", err, fh);
+                CERROR("-- done err %d (fh=%Lu)\n", err,
+                       (unsigned long long)fh);
 
                 GOTO(out, err);
         }
index 721e443..2920da1 100644 (file)
@@ -57,7 +57,7 @@ int mds_sendpage(struct ptlrpc_request *req, struct file *file,
 
         set_fs(KERNEL_DS);
         rc = mds_fs_readpage(&req->rq_obd->u.mds, file, buf, PAGE_SIZE,
-                             &offset);
+                             (loff_t *)&offset);
         set_fs(oldfs);
 
         if (rc != PAGE_SIZE) {
@@ -500,7 +500,8 @@ static int mds_prep(struct obd_device *obddev)
         }
 
         mds->mds_mount_count++;
-        CDEBUG(D_SUPER, "MDS mount_count is %Ld\n", mds->mds_mount_count);
+        CDEBUG(D_SUPER, "MDS mount_count is %Ld\n",
+               (unsigned long long)mds->mds_mount_count);
         off = 0;
         mount_count = cpu_to_le64(mds->mds_mount_count);
         rc = lustre_fwrite(f, (char *)&mount_count, sizeof(mount_count), &off);
index 4a366c7..51336ff 100644 (file)
@@ -255,7 +255,8 @@ int gen_copy_data(struct obd_conn *dst_conn, struct obdo *dst,
 
         ENTRY;
         CDEBUG(D_INFO, "src: ino %Ld blocks %Ld, size %Ld, dst: ino %Ld\n", 
-               src->o_id, src->o_blocks, src->o_size, dst->o_id);
+               (unsigned long long)src->o_id, (unsigned long long)src->o_blocks,
+               (unsigned long long)src->o_size, (unsigned long long)dst->o_id);
         page = alloc_page(GFP_USER);
         if ( !page ) {
                 EXIT;
index b5fa3a1..1b3dc02 100644 (file)
@@ -89,7 +89,8 @@ int echo_preprw(int cmd, struct obd_conn *conn, int objcount,
                         address = get_zeroed_page(GFP_KERNEL);
                         if (!address) {
                                 CERROR("can't get new page %d/%d for id %Ld\n",
-                                       j, obj->ioo_bufcnt, obj->ioo_id);
+                                       j, obj->ioo_bufcnt,
+                                       (unsigned long long)obj->ioo_id);
                                 rc = -ENOMEM;
                                 EXIT;
                                 goto preprw_cleanup;
@@ -125,7 +126,7 @@ preprw_cleanup:
          * all down again.  I believe that this is what the in-kernel
          * prep/commit operations do.
          */
-        CERROR("cleaning up %d pages (%d obdos)\n", r - res, objcount);
+        CERROR("cleaning up %ld pages (%d obdos)\n", (long)(r - res), objcount);
         while (r-- > res) {
                 unsigned long addr = r->addr;
 
@@ -164,7 +165,8 @@ int echo_commitrw(int cmd, struct obd_conn *conn, int objcount,
 
                         if (!addr || !kern_addr_valid(addr)) {
                                 CERROR("bad page %p, id %Ld (%d), buf %d/%d\n",
-                                       page, obj->ioo_id, i, j,obj->ioo_bufcnt);
+                                       page, (unsigned long long)obj->ioo_id, i,
+                                       j, obj->ioo_bufcnt);
                                 rc = -EFAULT;
                                 EXIT;
                                 goto commitrw_cleanup;
@@ -179,8 +181,8 @@ int echo_commitrw(int cmd, struct obd_conn *conn, int objcount,
         return 0;
 
 commitrw_cleanup:
-        CERROR("cleaning up %d pages (%d obdos)\n", niocount - (r - res) - 1,
-               objcount);
+        CERROR("cleaning up %ld pages (%d obdos)\n",
+               niocount - (long)(r - res) - 1, objcount);
         while (++r < res + niocount) {
                 struct page *page = r->page;
                 unsigned long addr = (unsigned long)page_address(page);
index cf579fb..063466b 100644 (file)
@@ -50,7 +50,7 @@ static char * obd_type_by_mode[S_IFMT >> S_SHIFT] = {
 static void filter_id(char *buf, obd_id id, obd_mode mode)
 {
         sprintf(buf, "O/%s/%Ld", obd_type_by_mode[(mode & S_IFMT) >> S_SHIFT],
-                id);
+                (unsigned long long)id);
 }
 
 /* setup the object store with correct subdirectories */
@@ -177,23 +177,23 @@ static struct file *filter_obj_open(struct obd_device *obddev,
         char name[24];
         struct super_block *sb;
         struct file *file;
-        
+        ENTRY;
+
         sb = obddev->u.filter.fo_sb;
         if (!sb || !sb->s_dev) {
                 CDEBUG(D_SUPER, "fatal: device not initialized.\n");
-                EXIT;
-                return NULL;
+                RETURN(NULL);
         }
 
         if ( !id ) {
-                CDEBUG(D_INODE, "fatal: invalid obdo %Lu\n", id);
-                EXIT;
-                return NULL;
+                CDEBUG(D_INODE, "fatal: invalid obdo %Lu\n",
+                       (unsigned long long)id);
+                RETURN(NULL);
         }
 
         if ( ! (type & S_IFMT) ) { 
                 CERROR("OBD filter_obj_open, no type (%Ld), mode %o!\n", 
-                       id, type);
+                       (unsigned long long)id, type);
         }
 
         filter_id(name, id, type); 
@@ -203,7 +203,7 @@ static struct file *filter_obj_open(struct obd_device *obddev,
 
         CDEBUG(D_INODE, "opening obdo %s\n", name);
 
-        return file;
+        RETURN(file);
 }
 
 static struct file *filter_parent(obd_id id, obd_mode mode)
@@ -595,7 +595,7 @@ static int filter_read(struct obd_conn *conn, struct obdo *oa, char *buf,
         }
 
         /* count doubles as retval */
-        retval = file->f_op->read(file, buf, *count, &offset);
+        retval = file->f_op->read(file, buf, *count, (loff_t *)&offset);
         filp_close(file, 0);
 
         if ( retval >= 0 ) {
@@ -632,7 +632,7 @@ static int filter_write(struct obd_conn *conn, struct obdo *oa, char *buf,
         }
 
         /* count doubles as retval */
-        retval = file->f_op->write(file, buf, *count, &offset);
+        retval = file->f_op->write(file, buf, *count, (loff_t *)&offset);
         filp_close(file, 0);
 
         if ( retval >= 0 ) {
@@ -691,10 +691,12 @@ static int filter_pgcache_brw(int rw, struct obd_conn *conn,
 
                 /* count doubles as retval */
                 for (pg = 0; pg < oa_bufs[onum]; pg++) {
-                        CDEBUG(D_INODE, "OP %d obdo no/pno: (%d,%d) (%ld,%ld) off count (%Ld,%Ld)\n", 
+                        CDEBUG(D_INODE, "OP %d obdo no/pno: (%d,%d) (%ld,%ld) "
+                               "off count (%Ld,%Ld)\n", 
                                rw, onum, pnum, file->f_dentry->d_inode->i_ino,
                                (unsigned long)offset[pnum] >> PAGE_CACHE_SHIFT,
-                               offset[pnum], count[pnum]);
+                               (unsigned long long)offset[pnum],
+                               (unsigned long long)count[pnum]);
                         if (rw == WRITE) { 
                                 loff_t off; 
                                 char *buffer;
index b1bd823..45493d2 100644 (file)
@@ -65,11 +65,11 @@ static ssize_t
 obdfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
         ssize_t retval;
-        CDEBUG(D_INFO, "Writing inode %ld, %d bytes, offset %Ld\n",
-               file->f_dentry->d_inode->i_ino, count, *ppos);
+        CDEBUG(D_INFO, "Writing inode %ld, %ld bytes, offset %Ld\n",
+               file->f_dentry->d_inode->i_ino, (long)count, *ppos);
 
         retval = generic_file_write(file, buf, count, ppos);
-        CDEBUG(D_INFO, "Wrote %d\n", retval);
+        CDEBUG(D_INFO, "Wrote %ld\n", (long)retval);
 
        /* update mtime/ctime/atime here, NOT size */
         if (retval > 0) {
index 340f4a5..985521e 100644 (file)
@@ -100,7 +100,7 @@ static struct dentry *obdfs_lookup(struct inode * dir, struct dentry *dentry)
                 goto negative;
 
         oa = obdo_fromid(IID(dir), ino, type, 
-                         OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS);
+                         (__u32)(OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS));
         if ( IS_ERR(oa) ) {
                 CERROR("obdo_fromid failed\n");
                 EXIT;
index 5326656..ba43795 100644 (file)
@@ -165,7 +165,7 @@ static int obdfs_brw(int rw, struct inode *inode, struct page *page, int create)
                 EXIT;
                 return -ENOMEM;
         }
-        oa->o_valid = OBD_MD_FLNOTOBD;
+        oa->o_valid = (__u32)OBD_MD_FLNOTOBD;
         obdfs_from_inode(oa, inode);
 
         err = obd_brw(rw, IID(inode), num_obdo, &oa, &bufs_per_obdo,
@@ -198,11 +198,11 @@ static int obdfs_commit_page(struct page *page, int create, int from, int to)
                 EXIT;
                 return -ENOMEM;
         }
-        oa->o_valid = OBD_MD_FLNOTOBD;
+        oa->o_valid = (__u32)OBD_MD_FLNOTOBD;
         obdfs_from_inode(oa, inode);
 
-        CDEBUG(D_INODE, "commit_page writing (at %d) to %d, count %Ld\n", 
-               from, to, count);
+        CDEBUG(D_INODE, "commit_page writing (at %d) to %d, count %Ld\n",
+               from, to, (unsigned long long)count);
 
         err = obd_brw(WRITE, IID(inode), num_obdo, &oa, &bufs_per_obdo,
                                &page, &count, &offset, &flags);
@@ -700,11 +700,11 @@ void obdfs_truncate(struct inode *inode)
                 err = -ENOMEM;
                 CERROR("obdo_alloc failed!\n");
         } else {
-                oa->o_valid = OBD_MD_FLNOTOBD;
+                oa->o_valid = (__u32)OBD_MD_FLNOTOBD;
                 obdfs_from_inode(oa, inode);
 
                 CDEBUG(D_INFO, "calling punch for %ld (%Lu bytes at 0)\n",
-                       (long)oa->o_id, oa->o_size);
+                       (long)oa->o_id, (unsigned long long)oa->o_size);
                 err = obd_punch(IID(inode), oa, oa->o_size, 0);
 
                 obdo_free(oa);
index 14ce596..fb74492 100644 (file)
@@ -189,7 +189,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb,
         /* make root inode */
         CDEBUG(D_INFO, "\n"); 
         oa = obdo_fromid(&sbi->osi_conn, root_ino, S_IFDIR,
-                         OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS);
+                         (__u32)(OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS));
         CDEBUG(D_INFO, "mode %o\n", oa->o_mode); 
         if ( IS_ERR(oa) ) {
                 CERROR("obdo_fromid failed\n");
index aca92f1..152f886 100644 (file)
@@ -520,7 +520,7 @@ int osc_brw_write(struct obd_conn *conn, obd_count num_oa, struct obdo **oa,
                 GOTO(out, rc = -EINVAL);
 
         if (request->rq_repmsg->buflens[1] != pages * sizeof(struct niobuf)) {
-                CERROR("buffer length wrong (%d vs. %d)\n",
+                CERROR("buffer length wrong (%d vs. %ld)\n",
                        request->rq_repmsg->buflens[1],
                        pages * sizeof(struct niobuf));
                 GOTO(out, rc = -EINVAL);
index 712cbf4..c85db78 100644 (file)
@@ -175,8 +175,9 @@ static int handle_incoming_request(struct obd_device *obddev,
                         CERROR("rq_reqmsg->conn: %p\n", request.rq_connection);
                         CERROR("real connection: %p\n", tmp);
                         CERROR("rq_reqmsg->token: %Lu\n",
-                               request.rq_reqmsg->token);
-                        CERROR("real token      : %Lu\n", tmp->c_token);
+                               (unsigned long long)request.rq_reqmsg->token);
+                        CERROR("real token      : %Lu\n",
+                               (unsigned long long)tmp->c_token);
                         LBUG();
                 }
                 ptlrpc_connection_addref(request.rq_connection);