struct cm_obd *cmobd = &obd->u.cm;
struct lustre_cfg* lcfg = buf;
struct lustre_id mid, lid;
- int valsize, rc;
+ __u32 valsize;
+ int rc;
ENTRY;
if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
static int cmobd_write_reint(struct obd_device *obd, void *rec)
{
struct cm_obd *cmobd = &obd->u.cm;
- struct obd_device *cache = cmobd->cache_exp->exp_obd;
struct obdo *oa = (struct obdo *)rec;
struct ldlm_extent *extent = NULL;
+ char *extents_buf = NULL;
+ struct obd_device *cache;
+ int rc = 0, ext_num = 0;
unsigned long csb, ino;
- char *extents_buf = NULL;
- int size = 0, rc = 0, ext_num = 0;
+ __u32 size = 0;
ENTRY;
size = sizeof(csb);
-
obd_get_info(cmobd->cache_exp, strlen("cache_sb") + 1,
"cache_sb", &size, &csb);
ino = *(int*)(&oa->o_inline[0]);
- rc = fsfilt_get_ino_write_extents(cache, (struct super_block *)csb, ino,
- &extents_buf, &ext_num);
+
+ cache = cmobd->cache_exp->exp_obd;
+ rc = fsfilt_get_ino_write_extents(cache, (struct super_block *)csb,
+ ino, &extents_buf, &ext_num);
if (rc)
GOTO(out, rc);
extent = (struct ldlm_extent *)extents_buf;
struct cm_obd *cmobd = &obd->u.cm;
struct llog_ctxt *ctxt = NULL;
struct llog_handle *llh;
- int val_size, rc = 0;
+ __u32 val_size;
+ int rc = 0;
ENTRY;
/* XXX just fetch the reintegration log context from
}
static inline int smfs_get_dentry_name_index(struct dentry *dentry,
- struct qstr *str,
+ struct qstr *str,
int *index)
{
char *name = (char *)dentry->d_name.name;
str->hash = end_name_hash(hash);
OBD_ALLOC(str_name, len + 1);
memcpy(str_name, dentry->d_name.name, len);
- str->len = len;
- str->name = str_name;
- if (index && c == ':') {
+ qstr_assign(str, str_name, len);
+ if (index && c == ':')
*index = simple_strtoul(name, 0, 0);
- }
return 0;
}
void unlock_dir(struct inode *dir, void *lock);
#endif
+/*
+ * typeof here is to suppress gcc warnings (gcc4, maybe others too) about wrong
+ * type in assignment. As kernel type may be chnaged we doing it this way.
+ * --umka
+ */
+#define qstr_assign(qstr, n, l) \
+do { \
+ typeof(l) _len = (l); \
+ typeof(n) _name = (n); \
+ (qstr)->name = (typeof((qstr)->name))_name; \
+ (qstr)->len = (typeof((qstr)->len))_len; \
+} while (0)
+
/* We need to hold the inode semaphore over the dcache lookup itself, or we run
* the risk of entering the filesystem lookup path concurrently on SMP systems,
* and instantiating two inodes for the same entry. We still protect against
ll_lookup_one_len(const char *name, struct dentry *dparent, int namelen)
{
struct dentry *dchild;
+
#ifdef S_PDIROPS
struct qstr qstr;
void *lock;
- qstr.name = name;
- qstr.len = namelen;
+
+ qstr_assign(&qstr, name, namelen);
lock = lock_dir(dparent->d_inode, &qstr);
#else
down(&dparent->d_inode->i_sem);
switch (sizeof(ptl_nid_t)) {
/* NB the casts only avoid compiler warnings */
case 8:
- snprintf(remote_uuid.uuid, sizeof remote_uuid,
+ snprintf((char *)remote_uuid.uuid, sizeof(remote_uuid),
"NET_"LPX64"_UUID", (__u64)req->rq_peer.peer_id.nid);
break;
case 4:
- snprintf(remote_uuid.uuid, sizeof remote_uuid,
+ snprintf((char *)remote_uuid.uuid, sizeof(remote_uuid),
"NET_%x_UUID", (__u32)req->rq_peer.peer_id.nid);
break;
default:
LBUG();
}
- tmp = lustre_msg_buf(req->rq_reqmsg, offset + 2, sizeof conn);
+ tmp = lustre_msg_buf(req->rq_reqmsg, offset + 2, sizeof(conn));
if (tmp == NULL)
GOTO(out, rc = -EPROTO);
static struct ldlm_state *ldlm_state;
-inline unsigned long round_timeout(unsigned long timeout)
+static inline unsigned long
+round_timeout(unsigned long timeout)
{
return ((timeout / HZ) + 1) * HZ;
}
memcpy(&lock->l_req_extent, &lock->l_policy_data.l_extent,
sizeof(lock->l_req_extent));
- err = ldlm_lock_enqueue(obddev->obd_namespace, &lock, cookie, &flags);
+ err = ldlm_lock_enqueue(obddev->obd_namespace, &lock,
+ cookie, (int *)&flags);
if (err)
GOTO(out, err);
- dlm_rep = lustre_msg_buf(req->rq_repmsg, 0, sizeof (*dlm_rep));
+ dlm_rep = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*dlm_rep));
dlm_rep->lock_flags = flags;
ldlm_lock2desc(lock, &dlm_rep->lock_desc);
l_unlock(&lock->l_resource->lr_namespace->ns_lock);
res = ldlm_lock_convert(lock, dlm_req->lock_desc.l_req_mode,
- &dlm_rep->lock_flags);
+ (int *)&dlm_rep->lock_flags);
if (res) {
l_lock(&lock->l_resource->lr_namespace->ns_lock);
if (ldlm_del_waiting_lock(lock))
if (req->rq_status)
GOTO(out, rc = req->rq_status);
- res = ldlm_lock_convert(lock, new_mode, &reply->lock_flags);
+ res = ldlm_lock_convert(lock, new_mode,
+ (int *)&reply->lock_flags);
if (res != NULL) {
ldlm_reprocess_all(res);
/* Go to sleep until the lock is granted. */
ll_frob_intent(&it, &lookup_it);
LASSERT(it != NULL);
- rc = md_intent_lock(exp, &pid, de->d_name.name, de->d_name.len,
+ rc = md_intent_lock(exp, &pid, (char *)de->d_name.name, de->d_name.len,
NULL, 0, &cid, it, flags, &req, ll_mdc_blocking_ast);
/* If req is NULL, then md_intent_lock() only tried to do a lock match;
* if all was well, it will return 1 if it found locks, 0 otherwise. */
LBUG();
}
- // We did that already, right? ll_inode2id(&pid, de->d_parent->d_inode);
- rc = md_intent_lock(exp, &pid, de->d_name.name,
- de->d_name.len, NULL, 0, NULL,
- it, 0, &req, ll_mdc_blocking_ast);
+ rc = md_intent_lock(exp, &pid, (char *)de->d_name.name, de->d_name.len,
+ NULL, 0, NULL, it, 0, &req, ll_mdc_blocking_ast);
if (rc >= 0) {
struct mds_body *mds_body = lustre_msg_buf(req->rq_repmsg, 1,
sizeof(*mds_body));
- /* See if we got same inode, if not - return error */
+ /* see if we got same inode, if not - return error */
if (id_equal_stc(&cid, &mds_body->id1))
goto revalidate_finish;
}
int lmmsize, struct lookup_intent *itp)
{
struct ll_sb_info *sbi = ll_i2sbi(file->f_dentry->d_inode);
+ const char *name = (char *)file->f_dentry->d_name.name;
struct dentry *parent = file->f_dentry->d_parent;
- const char *name = file->f_dentry->d_name.name;
const int len = file->f_dentry->d_name.len;
struct lustre_handle lockh;
struct mdc_op_data *op_data;
int lustre_init_dt_desc(struct ll_sb_info *sbi)
{
- int valsize, rc;
+ __u32 valsize;
+ int rc = 0;
ENTRY;
valsize = sizeof(sbi->ll_dt_desc);
sb->s_blocksize_bits = log2(osfs.os_bsize);
sb->s_maxbytes = PAGE_CACHE_MAXBYTES;
- devno = get_uuid2int(sbi->ll_md_exp->exp_obd->obd_uuid.uuid,
- strlen(sbi->ll_md_exp->exp_obd->obd_uuid.uuid));
+ devno = get_uuid2int((char *)sbi->ll_md_exp->exp_obd->obd_uuid.uuid,
+ strlen((char *)sbi->ll_md_exp->exp_obd->obd_uuid.uuid));
sb->s_dev = devno;
lustre_cfg_bufs_reset(&bufs, name);
lustre_cfg_bufs_set_string(&bufs, 1, LUSTRE_MDC_NAME);
- lustre_cfg_bufs_set_string(&bufs, 2, lmv_uuid.uuid);
+ lustre_cfg_bufs_set_string(&bufs, 2, (char *)lmv_uuid.uuid);
lcfg = lustre_cfg_new(LCFG_ATTACH, &bufs);
err = class_process_config(lcfg);
{
struct obd_export *md_exp = sbi->ll_md_exp;
struct lustre_mount_data *lmd = sbi->ll_lmd;
- struct llog_ctxt *ctxt;
- struct config_llog_instance cfg;
char *profile = lmd->lmd_profile, *name = NULL;
+ struct config_llog_instance cfg;
int rc, namelen = 0, version;
+ struct llog_ctxt *ctxt;
ENTRY;
if (profile == NULL)
if (rc == 0 && clean == 0) {
struct lov_desc desc;
- int rc, valsize;
+ __u32 valsize;
+ int rc = 0;
+
valsize = sizeof(desc);
rc = obd_get_info(sbi->ll_dt_exp, strlen("lovdesc") + 1,
"lovdesc", &valsize, &desc);
icbd.icbd_parent = parent;
ll_inode2id(&pid, parent);
- rc = md_intent_lock(ll_i2mdexp(parent), &pid,
- dentry->d_name.name, dentry->d_name.len, NULL, 0,
- NULL, it, flags, &req, ll_mdc_blocking_ast);
+ rc = md_intent_lock(ll_i2mdexp(parent), &pid, (char *)dentry->d_name.name,
+ dentry->d_name.len, NULL, 0, NULL, it, flags, &req,
+ ll_mdc_blocking_ast);
if (rc < 0)
GOTO(out, retval = ERR_PTR(rc));
RETURN(rc);
mdc_store_inode_generation(md_exp, request, MDS_REQ_INTENT_REC_OFF, 1);
- inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
- NULL, 0, mode, 0, it);
+ inode = ll_create_node(dir, (char *)dentry->d_name.name,
+ dentry->d_name.len, NULL, 0, mode, 0, it);
if (IS_ERR(inode))
RETURN(PTR_ERR(inode));
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n",
- nd->last.len, nd->last.name, dir->i_ino, dir->i_generation, dir);
+ nd->last.len, nd->last.name, dir->i_ino,
+ dir->i_generation, dir);
mode &= ~current->fs->umask;
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
- ll_prepare_mdc_data(op_data, dir, NULL, nd->last.name,
+ ll_prepare_mdc_data(op_data, dir, NULL,
+ (char *)nd->last.name,
nd->last.len, 0);
+
err = md_create(sbi->ll_md_exp, op_data, NULL, 0, mode,
current->fsuid, current->fsgid, rdev,
&request);
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
- ll_prepare_mdc_data(op_data, dir, NULL, dchild->d_name.name,
+
+ ll_prepare_mdc_data(op_data, dir, NULL,
+ (char *)dchild->d_name.name,
dchild->d_name.len, 0);
+
err = md_create(sbi->ll_md_exp, op_data, NULL, 0, mode,
current->fsuid, current->fsgid, rdev,
&request);
static int ll_symlink_raw(struct nameidata *nd, const char *tgt)
{
+ const char *name = (char *)nd->last.name;
struct inode *dir = nd->dentry->d_inode;
struct ptlrpc_request *request = NULL;
struct ll_sb_info *sbi = ll_i2sbi(dir);
- const char *name = nd->last.name;
struct mdc_op_data *op_data;
int len = nd->last.len;
int err = -EMLINK;
struct inode *src = srcnd->dentry->d_inode;
struct inode *dir = tgtnd->dentry->d_inode;
struct ptlrpc_request *request = NULL;
+ struct ll_sb_info *sbi = ll_i2sbi(dir);
struct mdc_op_data *op_data;
int err;
- struct ll_sb_info *sbi = ll_i2sbi(dir);
ENTRY;
CDEBUG(D_VFSTRACE,
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
- ll_prepare_mdc_data(op_data, src, dir, tgtnd->last.name,
+
+ ll_prepare_mdc_data(op_data, src, dir,
+ (char *)tgtnd->last.name,
tgtnd->last.len, 0);
+
err = md_link(sbi->ll_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (err == 0)
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
- ll_prepare_mdc_data(op_data, dir, NULL, nd->last.name,
+
+ ll_prepare_mdc_data(op_data, dir, NULL,
+ (char *)nd->last.name,
nd->last.len, 0);
+
err = md_create(sbi->ll_md_exp, op_data, NULL, 0, mode,
current->fsuid, current->fsgid, 0, &request);
OBD_FREE(op_data, sizeof(*op_data));
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n",
- nd->last.len, nd->last.name, dir->i_ino, dir->i_generation, dir);
+ nd->last.len, nd->last.name, dir->i_ino,
+ dir->i_generation, dir);
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
- ll_prepare_mdc_data(op_data, dir, NULL, nd->last.name,
+
+ ll_prepare_mdc_data(op_data, dir, NULL,
+ (char *)nd->last.name,
nd->last.len, S_IFDIR);
+
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (rc == 0)
int rc;
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n",
- nd->last.len, nd->last.name, dir->i_ino, dir->i_generation, dir);
+ nd->last.len, nd->last.name, dir->i_ino,
+ dir->i_generation, dir);
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
RETURN(-ENOMEM);
- ll_prepare_mdc_data(op_data, dir, NULL, nd->last.name, nd->last.len, 0);
+ ll_prepare_mdc_data(op_data, dir, NULL,
+ (char *)nd->last.name, nd->last.len, 0);
rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (rc)
if (op_data == NULL)
RETURN(-ENOMEM);
ll_prepare_mdc_data(op_data, src, tgt, NULL, 0, 0);
- err = md_rename(sbi->ll_md_exp, op_data, srcnd->last.name,
- srcnd->last.len, tgtnd->last.name, tgtnd->last.len,
- &request);
+ err = md_rename(sbi->ll_md_exp, op_data, (char *)srcnd->last.name,
+ srcnd->last.len, (char *)tgtnd->last.name,
+ tgtnd->last.len, &request);
OBD_FREE(op_data, sizeof(*op_data));
if (!err) {
ll_update_times(request, 0, src);
CDEBUG(D_INFO, "lmv idx %d is %s conn "LPX64"\n",
i, tgt->uuid.uuid, tgt->ltd_exp->exp_handle.h_cookie);
- if (strncmp(uuid->uuid, tgt->uuid.uuid, sizeof uuid->uuid) == 0)
+ if (!strncmp((char *)uuid->uuid, (char *)tgt->uuid.uuid, sizeof(uuid->uuid)))
break;
}
CDEBUG(D_INFO, "lov idx %d is %s conn "LPX64"\n",
i, tgt->uuid.uuid, tgt->ltd_exp->exp_handle.h_cookie);
- if (strncmp(uuid->uuid, tgt->uuid.uuid, sizeof uuid->uuid) == 0)
+ if (!strncmp((char *)uuid->uuid, (char *)tgt->uuid.uuid, sizeof(uuid->uuid)))
break;
}
RETURN(-EINVAL);
}
- if (strncmp(uuidp->uuid, tgt->uuid.uuid, sizeof uuidp->uuid) != 0) {
+ if (strncmp((char *)uuidp->uuid, (char *)tgt->uuid.uuid, sizeof(uuidp->uuid))) {
CERROR("LOV target UUID %s at index %d doesn't match %s.\n",
tgt->uuid.uuid, index, uuidp->uuid);
RETURN(-EINVAL);
tgtdesc = lov->tgts;
/* the uuid will be empty for deleted OSTs */
for (i = 0; i < count; i++, uuidp++, genp++, tgtdesc++) {
- obd_str2uuid(uuidp, tgtdesc->uuid.uuid);
+ obd_str2uuid(uuidp, (char *)tgtdesc->uuid.uuid);
*genp = tgtdesc->ltd_gen;
}
data->stripe_number);
RETURN(0);
} else if (keylen >= strlen("last_id") && strcmp(key, "last_id") == 0) {
+ __u32 size = sizeof(obd_id);
obd_id *ids = val;
- int rc, size = sizeof(obd_id);
+ int rc = 0;
+
for (i = 0; i < lov->desc.ld_tgt_count; i++) {
if (!lov->tgts[i].active)
continue;
fdentry = loghandle->lgh_file->f_dentry;
parent_inode = fdentry->d_parent->d_inode;
- if (!strcmp(fdentry->d_parent->d_name.name, "LOGS")) {
+ if (!strcmp((char *)fdentry->d_parent->d_name.name, "LOGS")) {
LASSERT(parent_inode == ctxt->loc_logs_dir->d_inode);
id_len = ll_id2str(id_name, fdentry->d_inode->i_ino,
GOTO(out, rc);
}
if (ctxt->loc_alone) {
- if (!strcmp(fdentry->d_parent->d_name.name, "OBJECTS")) {
+ if (!strcmp((char *)fdentry->d_parent->d_name.name, "OBJECTS")) {
LASSERT(parent_inode == ctxt->loc_objects_dir->d_inode);
dget(fdentry);
RETURN(-EPROTO);
req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_OBD_VERSION,
- OST_GET_INFO, 1, &keylen, bufs);
+ OST_GET_INFO, 1, (int *)&keylen, bufs);
if (req == NULL)
RETURN(-ENOMEM);
- req->rq_replen = lustre_msg_size(1, valsize);
+ req->rq_replen = lustre_msg_size(1, (int *)valsize);
rc = ptlrpc_queue_wait(req);
if (rc)
GOTO(out_req, rc);
}
flags = 0;
- res_id.name[2] = full_name_hash(name, namelen);
+ res_id.name[2] = full_name_hash((unsigned char *)name, namelen);
CDEBUG(D_INFO, "take lock on "DLID4":"LPX64"\n",
OLID4(id), res_id.name[2]);
if (keylen >= strlen("rootid") && !strcmp(key, "rootid")) {
struct lustre_id *reply;
- int size = sizeof(*reply);
+ __u32 size = sizeof(*reply);
- rc = lustre_pack_reply(req, 1, &size, NULL);
+ rc = lustre_pack_reply(req, 1, (int *)&size, NULL);
if (rc)
RETURN(rc);
rc = obd_get_info(exp, keylen, key, &size, reply);
} else {
obd_id *reply;
- int size = sizeof(*reply);
+ __u32 size = sizeof(*reply);
- rc = lustre_pack_reply(req, 1, &size, NULL);
+ rc = lustre_pack_reply(req, 1, (int *)&size, NULL);
if (rc)
RETURN(rc);
LASSERT(bitmap != NULL);
/* XXX if mcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
- if (!strcmp(med->med_mcd->mcd_uuid, obd->obd_uuid.uuid))
+ if (!strcmp((char *)med->med_mcd->mcd_uuid, (char *)obd->obd_uuid.uuid))
RETURN(0);
/* the bitmap operations can handle cl_idx > sizeof(long) * 8, so
RETURN(0);
/* XXX if mcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
- if (!strcmp(med->med_mcd->mcd_uuid, obd->obd_uuid.uuid))
+ if (!strcmp((char *)med->med_mcd->mcd_uuid, (char *)obd->obd_uuid.uuid))
GOTO(free_and_out, 0);
CDEBUG(D_INFO, "freeing client at idx %u (%lld)with UUID '%s'\n",
file->f_dentry->d_name.name, rc);
GOTO(err_msd, rc);
}
- if (strcmp(msd->msd_uuid, obd->obd_uuid.uuid) != 0) {
+ if (strcmp((char *)msd->msd_uuid, (char *)obd->obd_uuid.uuid)) {
CERROR("OBD UUID %s does not match last_rcvd UUID %s\n",
obd->obd_uuid.uuid, msd->msd_uuid);
GOTO(err_msd, rc = -EINVAL);
{
struct mds_obd *mds = &obd->u.mds;
struct lustre_handle conn = {0};
- int rc, valsize, value;
+ int rc, value;
+ __u32 valsize;
ENTRY;
if (IS_ERR(mds->mds_md_obd))
static int mds_dt_update_desc(struct obd_device *obd, struct obd_export *lov)
{
struct mds_obd *mds = &obd->u.mds;
- int valsize = sizeof(mds->mds_dt_desc), rc, i;
- int old_count = mds->mds_dt_desc.ld_tgt_count;
+ __u32 valsize = sizeof(mds->mds_dt_desc);
+ int old_count, rc = 0, i;
ENTRY;
- rc = obd_get_info(lov, strlen("lovdesc") + 1, "lovdesc", &valsize,
- &mds->mds_dt_desc);
+ old_count = mds->mds_dt_desc.ld_tgt_count;
+
+ rc = obd_get_info(lov, strlen("lovdesc") + 1, "lovdesc",
+ &valsize, &mds->mds_dt_desc);
if (rc)
RETURN(rc);
RETURN(0);
}
-int mds_dt_connect(struct obd_device *obd, char * lov_name)
+int mds_dt_connect(struct obd_device *obd, char *lov_name)
{
struct mds_obd *mds = &obd->u.mds;
struct lustre_handle conn = {0,};
/* If we're mounting this code for the first time on an existing FS,
* we need to populate the objids array from the real OST values */
if (!mds->mds_dt_objids_valid) {
- int size = sizeof(obd_id) * mds->mds_dt_desc.ld_tgt_count;
+ __u32 size = sizeof(obd_id) * mds->mds_dt_desc.ld_tgt_count;
rc = obd_get_info(mds->mds_dt_exp, strlen("last_id"),
"last_id", &size, mds->mds_dt_objids);
if (!rc) {
RETURN(-ENOLCK);
}
- parent_res_id.name[2] = full_name_hash(name, namelen - 1);
+ parent_res_id.name[2] = full_name_hash((unsigned char *)name,
+ namelen - 1);
CDEBUG(D_INFO, "take lock on %lu:%lu:"LPX64"\n",
(unsigned long)id_fid(id), (unsigned long)id_group(id),
GOTO(cleanup, rc = -ENOLCK);
}
- tgt_dir_res_id.name[2] = full_name_hash(rec->ur_name,
+ tgt_dir_res_id.name[2] = full_name_hash((unsigned char *)rec->ur_name,
rec->ur_namelen - 1);
CDEBUG(D_INFO, "take lock on %lu:%lu:"LPX64"\n",
(unsigned long)id_fid(rec->ur_id2),
if (rc != ELDLM_OK)
GOTO(cleanup, rc);
- p1_res_id.name[2] = full_name_hash(old_name, old_len - 1);
- p2_res_id.name[2] = full_name_hash(new_name, new_len - 1);
+ p1_res_id.name[2] = full_name_hash((unsigned char *)old_name,
+ old_len - 1);
+ p2_res_id.name[2] = full_name_hash((unsigned char *)new_name,
+ new_len - 1);
CDEBUG(D_INFO, "take locks on "
LPX64":"LPX64":"LPX64", "LPX64":"LPX64":"LPX64"\n",
lustre_cfg_bufs_set_string(&bufs, 0, inst_name);
}
- if (cfg && lcfg->lcfg_command == LCFG_ATTACH) {
- lustre_cfg_bufs_set_string(&bufs, 2, cfg->cfg_uuid.uuid);
- }
+ if (cfg && lcfg->lcfg_command == LCFG_ATTACH)
+ lustre_cfg_bufs_set_string(&bufs, 2,
+ (char *)cfg->cfg_uuid.uuid);
lcfg_new = lustre_cfg_new(lcfg->lcfg_command, &bufs);
lcfg_new->lcfg_num = lcfg->lcfg_num;
struct uuid uuid;
uuid_unpack(uu, &uuid);
- sprintf(out->uuid,
+ sprintf((char *)out->uuid,
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uuid.time_low, uuid.time_mid, uuid.time_hi_and_version,
uuid.clock_seq >> 8, uuid.clock_seq & 0xFF,
sizeof LUSTRE_MDC_NAME) == 0)) {
struct client_obd *cli = &obd->u.cli;
struct obd_import *imp = cli->cl_import;
- if (strncmp(tgtuuid->uuid, imp->imp_target_uuid.uuid,
+ if (strncmp((char *)tgtuuid->uuid, (char *)imp->imp_target_uuid.uuid,
sizeof(imp->imp_target_uuid)) == 0)
return obd;
}
LASSERT(bitmap != NULL);
/* XXX if fcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
- if (!strcmp(fed->fed_fcd->fcd_uuid, obd->obd_uuid.uuid))
+ if (!strcmp((char *)fed->fed_fcd->fcd_uuid, (char *)obd->obd_uuid.uuid))
RETURN(0);
/* the bitmap operations can handle cl_idx > sizeof(long) * 8, so
GOTO(free, 0);
/* XXX if fcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
- if (strcmp(fed->fed_fcd->fcd_uuid, obd->obd_uuid.uuid ) == 0)
+ if (!strcmp((char *)fed->fed_fcd->fcd_uuid, (char *)obd->obd_uuid.uuid))
GOTO(free, 0);
LASSERT(filter->fo_last_rcvd_slots != NULL);
LAST_RCVD, rc);
GOTO(err_fsd, rc);
}
- if (strcmp(fsd->fsd_uuid, obd->obd_uuid.uuid) != 0) {
+ if (strcmp((char *)fsd->fsd_uuid, (char *)obd->obd_uuid.uuid)) {
CERROR("OBD UUID %s does not match last_rcvd UUID %s\n",
obd->obd_uuid.uuid, fsd->fsd_uuid);
GOTO(err_fsd, rc = -EINVAL);
extern void *lock_dir(struct inode *dir, struct qstr *name);
extern void unlock_dir(struct inode *dir, void *lock);
-static void * filter_lock_dentry(struct obd_device *obd,
- struct dentry *dparent, obd_id id)
+static void *filter_lock_dentry(struct obd_device *obd,
+ struct dentry *dparent,
+ obd_id id)
{
#ifdef S_PDIROPS
struct qstr qstr;
char name[32];
- qstr.name = name;
- qstr.len = sprintf(name, LPU64, id);
+ int len;
+
+ len = sprintf(name, LPU64, id);
+ qstr_assign(&qstr, (char *)name, len);
return lock_dir(dparent->d_inode, &qstr);
#else
down(&dparent->d_inode->i_sem);
int requested_nob, int niocount,
obd_count page_count, struct brw_page *pga)
{
- int *remote_rcs, i;
+ int *remote_rcs, i;
/* return error if any niobuf was in error */
remote_rcs = lustre_swab_repbuf(request, 1,
}
if (lustre_msg_swabbed(request->rq_repmsg))
for (i = 0; i < niocount; i++)
- __swab32s(&remote_rcs[i]);
+ __swab32s((__u32 *)&remote_rcs[i]);
for (i = 0; i < niocount; i++) {
if (remote_rcs[i] < 0)
char *bufs[1] = {key};
int rc;
req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_OBD_VERSION,
- OST_GET_INFO, 1, &keylen, bufs);
+ OST_GET_INFO, 1, (int *)&keylen, bufs);
if (req == NULL)
RETURN(-ENOMEM);
- req->rq_replen = lustre_msg_size(1, vallen);
+ req->rq_replen = lustre_msg_size(1, (int *)vallen);
rc = ptlrpc_queue_wait(req);
if (rc)
GOTO(out, rc);
RETURN(rc);
reply = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*reply));
- rc = obd_get_info(exp, keylen, key, &size, reply);
+ rc = obd_get_info(exp, keylen, key, (__u32 *)&size, reply);
req->rq_repmsg->status = 0;
RETURN(rc);
}
list_add_tail(&req->rq_replay_list, &imp->imp_replay_list);
}
+int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req);
+
int ptlrpc_queue_wait(struct ptlrpc_request *req)
{
char str[PTL_NALFMT_SIZE];
GOTO(out, c);
if (uuid && uuid->uuid) /* XXX ???? */
- obd_str2uuid(&c->c_remote_uuid, uuid->uuid);
+ obd_str2uuid(&c->c_remote_uuid, (char *)uuid->uuid);
atomic_set(&c->c_refcount, 0);
memcpy(&c->c_peer, peer, sizeof(c->c_peer));
ptl_nid_t peer_nid;
int i;
char str[PTL_NALFMT_SIZE];
- int rc = lustre_uuid_to_peer(uuid->uuid,
+ int rc = lustre_uuid_to_peer((char *)uuid->uuid,
&peer_nal, &peer_nid);
if (rc != 0)
RETURN (rc);
sizeof(imp->imp_connect_flags),
sizeof(imp->imp_connect_data)};
char *tmp[] = {NULL,
- imp->imp_target_uuid.uuid,
- obd->obd_uuid.uuid,
+ (char *)imp->imp_target_uuid.uuid,
+ (char *)obd->obd_uuid.uuid,
(char *)&imp->imp_dlm_handle,
(char *)&imp->imp_connect_flags, /* XXX: make this portable! */
(char*) &imp->imp_connect_data};
GOTO(out_close, rc);
memset(buf, 0, LLOG_CHUNK_SIZE);
- rc = llog_next_block(loghandle, &body->lgd_saved_index,
- body->lgd_index,
- &body->lgd_cur_offset, buf, LLOG_CHUNK_SIZE);
+ rc = llog_next_block(loghandle, (int *)&body->lgd_saved_index,
+ body->lgd_index, &body->lgd_cur_offset,
+ buf, LLOG_CHUNK_SIZE);
if (rc)
GOTO(out_close, rc);
argv[0] = obd_lustre_upcall;
argv[1] = "RECOVERY_OVER";
- argv[2] = obd->obd_uuid.uuid;
+ argv[2] = (char *)obd->obd_uuid.uuid;
argv[3] = NULL;
envp[0] = "HOME=/";
argv[0] = obd_lustre_upcall;
argv[1] = "FAILED_IMPORT";
- argv[2] = imp->imp_target_uuid.uuid;
+ argv[2] = (char *)imp->imp_target_uuid.uuid;
argv[3] = imp->imp_obd->obd_name;
- argv[4] = imp->imp_connection->c_remote_uuid.uuid;
- argv[5] = imp->imp_obd->obd_uuid.uuid;
+ argv[4] = (char *)imp->imp_connection->c_remote_uuid.uuid;
+ argv[5] = (char *)imp->imp_obd->obd_uuid.uuid;
argv[6] = NULL;
envp[0] = "HOME=/";
buf_to_sg(sg, header, hdrlen);
crypto_digest_update(tfm, sg, 1);
if (body->len) {
- buf_to_sg(sg, body->data, body->len);
+ buf_to_sg(sg, (char *)body->data, body->len);
crypto_digest_update(tfm, sg, 1);
}
#include "gss_krb5.h"
rawobj_t gss_mech_krb5_oid =
- {9, "\052\206\110\206\367\022\001\002\002"};
+{9, (__u8 *)"\052\206\110\206\367\022\001\002\002"};
static inline int
get_bytes(char **ptr, const char *end, void *res, int len)
gss_import_sec_context_kerberos(rawobj_t *inbuf,
struct gss_ctx *ctx_id)
{
- char *p = inbuf->data;
- char *end = inbuf->data + inbuf->len;
+ char *p = (char *)inbuf->data;
+ char *end = (char *)(inbuf->data + inbuf->len);
struct krb5_ctx *ctx;
OBD_ALLOC(ctx, sizeof(*ctx));
*(__u16 *)(krb5_hdr + 2) = cpu_to_be16(ctx->signalg);
memset(krb5_hdr + 4, 0xff, 4);
- if (make_checksum(checksum_type, krb5_hdr, 8, text, &md5cksum))
+ if (make_checksum(checksum_type, (char *)krb5_hdr, 8, text, &md5cksum))
goto out_err;
switch (ctx->signalg) {
switch (signalg) {
case SGN_ALG_DES_MAC_MD5:
- ret = make_checksum(checksum_type, ptr - 2, 8,
- message_buffer, &md5cksum);
+ ret = make_checksum(checksum_type, (char *)(ptr - 2),
+ 8, message_buffer, &md5cksum);
if (ret)
goto out;
data_desc.data = msgbuf->buf + msgbuf->dataoff - blocksize;
data_desc.len = msgbuf->datalen + blocksize;
- if (make_checksum(checksum_type, krb5_hdr, 8, &data_desc, &md5cksum)) {
+ if (make_checksum(checksum_type, (char *)krb5_hdr,
+ 8, &data_desc, &md5cksum)) {
CERROR("checksum error\n");
RETURN(GSS_S_FAILURE);
}
switch (signalg) {
case SGN_ALG_DES_MAC_MD5:
checksum_type = CKSUMTYPE_RSA_MD5;
- major = make_checksum(checksum_type, krb5_hdr, 8,
- &plain_out, &md5cksum);
+ major = make_checksum(checksum_type, (char *)krb5_hdr,
+ 8, &plain_out, &md5cksum);
if (major) {
CERROR("make checksum err: 0x%x\n", major);
GOTO(out_free, major);
struct ptlrpcs_wire_hdr *hdr;
struct lustre_msg *lmsg;
struct mds_req_sec_desc *secdesc;
- __u32 size = sizeof(*secdesc);
+ int size = sizeof(*secdesc);
__u32 lmsg_size, *p;
int rc;
struct gss_cl_ctx **gc,
struct gss_upcall_msg_data *gmd, int *gss_err)
{
- char *p = buf->data;
- __u32 len = buf->len;
+ char *p = (char *)buf->data;
struct gss_cl_ctx *ctx;
- rawobj_t tmp_buf;
+ __u32 len = buf->len;
unsigned int timeout;
+ rawobj_t tmp_buf;
int err = -EPERM;
ENTRY;
vlen -= 4;
mic.len = vlen;
- mic.data = (char *) vp;
+ mic.data = (unsigned char *)vp;
CDEBUG(D_SEC, "reqbuf at %p, lmsg at %p, len %d, mic at %p, len %d\n",
req->rq_reqbuf, lmsg.data, lmsg.len, mic.data, mic.len);
CERROR("vlen %d, mic.len %d\n", vlen, mic.len);
RETURN(-EINVAL);
}
- mic.data = (char *) vp;
+ mic.data = (unsigned char *)vp;
gcred = container_of(cred, struct gss_cred, gc_base);
ctx = gss_cred_get_ctx(cred);
if (left)
GOTO(err_free, err = -EFAULT);
- obj.data = buf;
+ obj.data = (unsigned char *)buf;
obj.len = mlen;
LASSERT(rpci->private);
static inline int rsi_hash(struct rsi *item)
{
- return hash_mem(item->in_handle.data, item->in_handle.len, RSI_HASHBITS)
- ^ hash_mem(item->in_token.data, item->in_token.len, RSI_HASHBITS);
+ return hash_mem((char *)item->in_handle.data, item->in_handle.len, RSI_HASHBITS)
+ ^ hash_mem((char *)item->in_token.data, item->in_token.len, RSI_HASHBITS);
}
static inline int rsi_match(struct rsi *item, struct rsi *tmp)
{
struct rsi *rsii = container_of(h, struct rsi, h);
- qword_addhex(bpp, blen, (char *) &rsii->naltype, sizeof(rsii->naltype));
- qword_addhex(bpp, blen, (char *) &rsii->netid, sizeof(rsii->netid));
- qword_addhex(bpp, blen, (char *) &rsii->nid, sizeof(rsii->nid));
- qword_addhex(bpp, blen, rsii->in_handle.data, rsii->in_handle.len);
- qword_addhex(bpp, blen, rsii->in_token.data, rsii->in_token.len);
+ qword_addhex(bpp, blen, (char *)&rsii->naltype, sizeof(rsii->naltype));
+ qword_addhex(bpp, blen, (char *)&rsii->netid, sizeof(rsii->netid));
+ qword_addhex(bpp, blen, (char *)&rsii->nid, sizeof(rsii->nid));
+ qword_addhex(bpp, blen, (char *)rsii->in_handle.data, rsii->in_handle.len);
+ qword_addhex(bpp, blen, (char *)rsii->in_token.data, rsii->in_token.len);
(*bpp)[-1] = '\n';
}
static inline int
rsc_hash(struct rsc *rsci)
{
- return hash_mem(rsci->handle.data, rsci->handle.len, RSC_HASHBITS);
+ return hash_mem((char *)rsci->handle.data,
+ rsci->handle.len, RSC_HASHBITS);
}
static inline int
static int rsc_parse(struct cache_detail *cd,
char *mesg, int mlen)
{
- /* contexthandle expiry [ uid gid N <n gids> mechname ...mechdata... ] */
+ /* contexthandle expiry [ uid gid N <n gids> mechname
+ * ...mechdata... ] */
char *buf = mesg;
int len, rv;
struct rsc *rsci, *res = NULL;
goto out;
/* remote flag */
- rv = get_int(&mesg, &rsci->remote_realm);
+ rv = get_int(&mesg, (int *)&rsci->remote_realm);
if (rv) {
CERROR("fail to get remote flag\n");
goto out;
}
/* mapped uid */
- rv = get_int(&mesg, &rsci->mapped_uid);
+ rv = get_int(&mesg, (int *)&rsci->mapped_uid);
if (rv) {
CERROR("fail to get mapped uid\n");
goto out;
}
/* uid, or NEGATIVE */
- rv = get_int(&mesg, &rsci->cred.vc_uid);
+ rv = get_int(&mesg, (int *)&rsci->cred.vc_uid);
if (rv == -EINVAL)
goto out;
if (rv == -ENOENT) {
__u64 ctx_expiry;
/* gid */
- if (get_int(&mesg, &rsci->cred.vc_gid))
+ if (get_int(&mesg, (int *)&rsci->cred.vc_gid))
goto out;
/* mech name */
goto out;
}
tmp_buf.len = len;
- tmp_buf.data = buf;
+ tmp_buf.data = (unsigned char *)buf;
if (kgss_import_sec_context(&tmp_buf, gm, &rsci->mechctx)) {
kgss_mech_put(gm);
goto out;
msg.data = (__u8 *)req->rq_reqmsg;
mic.len = le32_to_cpu(*vp++);
- mic.data = (char *) vp;
+ mic.data = (unsigned char *)vp;
vlen -= 4;
if (mic.len > vlen) {
vlen -= 7 * 4;
mic.len = vlen;
- mic.data = (char *) vp;
+ mic.data = (unsigned char *)vp;
major = kgss_get_mic(rscp->mechctx, 0, &lmsg, &mic);
if (major) {
if (S_ISDIR(inode->i_mode)) {
if (inode->i_nlink != 2)
return 0;
- if (!strncmp(dentry->d_name.name, "lost+found",
- dentry->d_name.len))
+ if (!strncmp((char *)dentry->d_name.name,
+ "lost+found", dentry->d_name.len))
return 0;
LASSERT(active_entry != NULL);
get_active_entry(inode, active_entry);
} else {
if (inode->i_nlink != 1)
return 0;
- if (!strncmp(dentry->d_name.name, KML_LOG_NAME, dentry->d_name.len) ||
- !strncmp(dentry->d_name.name, CACHE_LRU_LOG, dentry->d_name.len))
+ if (!strncmp((char *)dentry->d_name.name, KML_LOG_NAME, dentry->d_name.len) ||
+ !strncmp((char *)dentry->d_name.name, CACHE_LRU_LOG, dentry->d_name.len))
return 0;
return 1;
}
{
if (((op == 0 && dentry->d_inode->i_nlink == 0) ||
(op == 1 && dentry->d_inode->i_nlink == 2)) &&
- strncmp(dentry->d_name.name, KML_LOG_NAME, dentry->d_name.len) &&
- strncmp(dentry->d_name.name, CACHE_LRU_LOG, dentry->d_name.len))
+ strncmp((char *)dentry->d_name.name, KML_LOG_NAME, dentry->d_name.len) &&
+ strncmp((char *)dentry->d_name.name, CACHE_LRU_LOG, dentry->d_name.len))
return 1;
else if ((op == 2 && dentry->d_inode->i_nlink == 0) ||
(op == 3 && dentry->d_inode->i_nlink == 3)) {
static int fsfilt_smfs_write_extents(struct dentry *dentry,
unsigned long from, unsigned long num)
{
+ /* TODO: fix this later */
+#if 0
int rc = 0;
struct inode * cache_inode = I2CI(dentry->d_inode);
struct hook_write_msg msg = {
ENTRY;
- /*TODO: fix this later
pre_smfs_inode(dentry->d_inode, cache_inode);
SMFS_PRE_HOOK(dentry->d_inode, HOOK_WRITE, &msg);
rc = smfs_write_extents(dentry->d_inode, dentry, from, num);
SMFS_POST_HOOK(dentry->d_inode, HOOK_WRITE, &msg, rc);
post_smfs_inode(dentry->d_inode, cache_inode);
- */
RETURN(rc);
+#endif
+ ENTRY;
+ RETURN(0);
}
static int fsfilt_smfs_precreate_rec(struct dentry *dentry, int *count,
RETURN(rc);
}
+#if 0
+/* not used curently */
static smfs_pack_rec_func smfs_get_rec_pack_type(struct super_block *sb)
{
int idx = 0;
idx = GET_REC_PACK_TYPE_INDEX(smsi->smsi_flags);
return smsi->smsi_pack_rec[idx];
}
+#endif
static inline void
copy_inode_attr(struct iattr *iattr, struct inode *inode)
RETURN(rc);
}
-static int kml_link(struct inode * inode, void *arg, struct kml_priv * priv)
+static int kml_link(struct inode *inode, void *arg, struct kml_priv *priv)
{
- struct hook_link_msg * msg = arg;
- int rc = 0, length = 0, buf_len = 0;
- char *buffer = NULL, *pbuf = NULL;
- struct smfs_super_info *smb;
+ struct hook_link_msg *msg = arg;
+ int rc = 0, length = 0;
+ char *buffer = NULL;
ENTRY;
OBD_ALLOC(buffer, PAGE_SIZE);
RETURN(rc);
}
-static int kml_symlink(struct inode * inode, void *arg, struct kml_priv * priv)
+static int kml_symlink(struct inode *inode, void *arg, struct kml_priv *priv)
{
- struct hook_symlink_msg * msg = arg;
struct smfs_super_info *smb = S2SMI(inode->i_sb);
- char *buffer = NULL, *pbuf;
+ struct hook_symlink_msg *msg = arg;
int rc = 0, length = 0;
+ char *buffer = NULL;
ENTRY;
OBD_ALLOC(buffer, PAGE_SIZE);
RETURN(rc);
}
-static int kml_rename(struct inode * inode, void *arg, struct kml_priv * priv)
+static int kml_rename(struct inode *inode, void *arg, struct kml_priv *priv)
{
- struct hook_rename_msg * msg = arg;
- char *buffer = NULL, *pbuf = NULL;
- int rc = 0, length = 0, buf_len = 0;
+ struct hook_rename_msg *msg = arg;
+ int rc = 0, length = 0;
+ char *buffer = NULL;
ENTRY;
OBD_ALLOC(buffer, PAGE_SIZE);
RETURN(rc);
}
-static int kml_setattr(struct inode * inode, void *arg, struct kml_priv * priv)
+static int kml_setattr(struct inode *inode, void *arg, struct kml_priv *priv)
{
- struct hook_setattr_msg * msg = arg;
- char *buffer = NULL, *pbuf;
- int rc = 0, length = 0, buf_len = 0;
+ struct hook_setattr_msg *msg = arg;
+ int rc = 0, length = 0;
+ char *buffer = NULL;
ENTRY;
OBD_ALLOC(buffer, PAGE_SIZE);
return -ENOMEM;
mdc_prepare_mdc_data(op_data, src->d_inode, dir,
- tgt->d_name.name, tgt->d_name.len, 0);
+ (char *)tgt->d_name.name,
+ tgt->d_name.len, 0);
PACK_KML_REC_INIT(buffer, MDS_REINT);
mkpi = (struct mds_kml_pack_info *)buffer;
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
return -ENOMEM;
+
mdc_prepare_mdc_data(op_data, dir, dentry->d_inode,
- dentry->d_name.name, dentry->d_name.len, 0);
+ (char *)dentry->d_name.name,
+ dentry->d_name.len, 0);
PACK_KML_REC_INIT(buffer, MDS_REINT);
mkpi = (struct mds_kml_pack_info *)buffer;
OBD_ALLOC(op_data, sizeof(*op_data));
if (op_data == NULL)
return -ENOMEM;
+
mdc_prepare_mdc_data(op_data, dir, NULL,
- dentry->d_name.name,
+ (char *)dentry->d_name.name,
dentry->d_name.len, mode);
PACK_KML_REC_INIT(buffer, MDS_REINT);
msg = (struct lustre_msg *)(buffer + sizeof(*mkpi));
lustre_init_msg(msg, mkpi->mpi_bufcount, mkpi->mpi_size, NULL);
- tmp = mdc_rename_pack(msg, 0, op_data, dentry->d_name.name,
- dentry->d_name.len, new_dentry->d_name.name,
+ tmp = mdc_rename_pack(msg, 0, op_data, (char *)dentry->d_name.name,
+ dentry->d_name.len, (char *)new_dentry->d_name.name,
new_dentry->d_name.len);
mkpi->mpi_total_size = tmp - (void*)msg;
int fromlen =sizeof(from);
memset(buffer, 0, sizeof(buffer));
- rc = recvfrom(sockfd, buffer, sizeof(buffer), 0,
- (struct sockaddr *)&from, &fromlen);
+ rc = recvfrom(sockfd, buffer, sizeof(buffer),
+ 0, (struct sockaddr *)&from,
+ (socklen_t *)&fromlen);
if (rc <= 0) {
perror("recvfrom()");
rc = errno;
if (param->obduuid) {
for (i = 0, uuidp = uuids; i < obdcount; i++, uuidp++) {
- if (strncmp(param->obduuid->uuid, uuidp->uuid,
+ if (strncmp((char *)param->obduuid->uuid, (char *)uuidp->uuid,
sizeof(*uuidp)) == 0) {
param->obdindex = i;
break;
/* read user/group database */
ioc_data.err = get_groups_local(ioc_data.uid, &ioc_data.gid,
- &ioc_data.ngroups, &ioc_data.groups);
+ (int *)&ioc_data.ngroups,
+ &ioc_data.groups);
if (ioc_data.err)
goto do_downcall;
/* read lsd config database */
conf_fp = fopen(conf_name, "r");
if (conf_fp) {
- get_perms(conf_fp, ioc_data.uid, &ioc_data.nperms,
+ get_perms(conf_fp, ioc_data.uid,
+ (int *)&ioc_data.nperms,
&ioc_data.perms);
fclose(conf_fp);
}