len = sprintf(name, LPU64, id);
CDEBUG(D_INODE, "opening object O/%*s/%s\n",
dparent->d_name.len, dparent->d_name.name, name);
- if (!locked)
- down(&dparent->d_inode->i_sem);
+ //if (!locked)
+ //down(&dparent->d_inode->i_sem);
dchild = lookup_one_len(name, dparent, len);
- if (!locked)
- up(&dparent->d_inode->i_sem);
+ //if (!locked)
+ //up(&dparent->d_inode->i_sem);
if (IS_ERR(dchild)) {
CERROR("child lookup error %ld\n", PTR_ERR(dchild));
RETURN(dchild);
RETURN(ERR_PTR(-EINVAL));
}
- ffd = kmem_cache_alloc(filter_open_cache, SLAB_KERNEL);
+ PORTAL_SLAB_ALLOC(ffd, filter_open_cache, sizeof(*ffd));
if (!ffd) {
CERROR("obdfilter: out of memory\n");
RETURN(ERR_PTR(-ENOMEM));
pop_ctxt(&saved, &filter->fo_ctxt, NULL);
if (IS_ERR(file)) {
- CERROR("error opening %s: rc %d\n", name, PTR_ERR(file));
+ CERROR("error opening %s: rc %ld\n", name, PTR_ERR(file));
GOTO(out_fdd, file);
}
kmem_cache_free(filter_dentry_cache, fdd);
out_ffd:
ffd->ffd_servercookie = DEAD_HANDLE_MAGIC;
- kmem_cache_free(filter_open_cache, ffd);
+ PORTAL_SLAB_FREE(ffd, filter_open_cache, sizeof(*ffd));
goto out;
}
}
f_dput(object_dentry);
- kmem_cache_free(filter_open_cache, ffd);
+ PORTAL_SLAB_FREE(ffd, filter_open_cache, sizeof(*ffd));
RETURN(rc);
}
}
static int filter_brw(int cmd, struct lustre_handle *conn,
- struct lov_stripe_md *lsm, obd_count oa_bufs,
- struct brw_page *pga, struct obd_brw_set *set)
+ struct lov_stripe_md *lsm, obd_count oa_bufs,
+ struct brw_page *pga, struct obd_brw_set *set)
{
struct obd_ioobj ioo;
struct niobuf_local *lnb;
OBD_ALLOC(lnb, oa_bufs * sizeof(struct niobuf_local));
OBD_ALLOC(rnb, oa_bufs * sizeof(struct niobuf_remote));
- if ( lnb == NULL || rnb == NULL )
+ if (lnb == NULL || rnb == NULL)
GOTO(out, ret = -ENOMEM);
- for ( i = 0 ; i < oa_bufs ; i++ ) {
+ for (i = 0; i < oa_bufs; i++) {
rnb[i].offset = pga[i].off;
rnb[i].len = pga[i].count;
}
ioo.ioo_type = S_IFREG;
ioo.ioo_bufcnt = oa_bufs;
- ret = filter_preprw(cmd, conn, 1, &ioo, oa_bufs, rnb, lnb,
- &desc_private);
- if ( ret != 0 )
+ ret = filter_preprw(cmd, conn, 1, &ioo, oa_bufs, rnb, lnb,
+ &desc_private);
+ if (ret != 0)
GOTO(out, ret);
- for ( i = 0; i < oa_bufs ; i++ ) {
+ for (i = 0; i < oa_bufs; i++) {
void *virt = kmap(pga[i].pg);
obd_off off = pga[i].off & ~PAGE_MASK;
- if ( cmd & OBD_BRW_WRITE )
+ if (cmd & OBD_BRW_WRITE)
memcpy(lnb[i].addr + off, virt + off, pga[i].count);
else
memcpy(virt + off, lnb[i].addr + off, pga[i].count);
ret = filter_commitrw(cmd, conn, 1, &ioo, oa_bufs, lnb, desc_private);
out:
- if ( lnb )
+ if (lnb)
OBD_FREE(lnb, oa_bufs * sizeof(struct niobuf_local));
- if ( rnb )
+ if (rnb)
OBD_FREE(rnb, oa_bufs * sizeof(struct niobuf_remote));
RETURN(ret);
}
}
static struct obd_ops filter_obd_ops = {
- o_attach: filter_attach,
- o_detach: filter_detach,
- o_get_info: filter_get_info,
- o_setup: filter_setup,
- o_cleanup: filter_cleanup,
- o_connect: filter_connect,
- o_disconnect: filter_disconnect,
- o_statfs: filter_statfs,
- o_getattr: filter_getattr,
- o_create: filter_create,
- o_setattr: filter_setattr,
- o_destroy: filter_destroy,
- o_open: filter_open,
- o_close: filter_close,
- o_brw: filter_brw,
- o_punch: filter_truncate,
- o_preprw: filter_preprw,
- o_commitrw: filter_commitrw
+ o_owner: THIS_MODULE,
+ o_attach: filter_attach,
+ o_detach: filter_detach,
+ o_get_info: filter_get_info,
+ o_setup: filter_setup,
+ o_cleanup: filter_cleanup,
+ o_connect: filter_connect,
+ o_disconnect: filter_disconnect,
+ o_statfs: filter_statfs,
+ o_getattr: filter_getattr,
+ o_create: filter_create,
+ o_setattr: filter_setattr,
+ o_destroy: filter_destroy,
+ o_open: filter_open,
+ o_close: filter_close,
+ o_brw: filter_brw,
+ o_punch: filter_truncate,
+ o_preprw: filter_preprw,
+ o_commitrw: filter_commitrw
#if 0
- o_preallocate: filter_preallocate_inodes,
- o_migrate: filter_migrate,
- o_copy: filter_copy_data,
- o_iterate: filter_iterate
+ o_preallocate: filter_preallocate_inodes,
+ o_migrate: filter_migrate,
+ o_copy: filter_copy_data,
+ o_iterate: filter_iterate
#endif
};