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,
{
#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;
(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);
}
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:
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,
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) {
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)));
}
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)) {
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);
inode->i_mapping->a_ops = &ll_aops;
err = ext2_add_nondir(dentry, inode);
}
- EXIT;
- return err;
+ RETURN(err);
} /* ll_create */
}
#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();
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);
}
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);
}
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;
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);
}
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;
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) {
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);
}
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) {
}
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);
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;
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;
* 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;
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;
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);
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 */
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);
CDEBUG(D_INODE, "opening obdo %s\n", name);
- return file;
+ RETURN(file);
}
static struct file *filter_parent(obd_id id, obd_mode mode)
}
/* 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 ) {
}
/* 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 ) {
/* 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;
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) {
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;
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,
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);
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);
/* 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");
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);
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);