#define DEBUG_SUBSYSTEM S_MDC
-#ifdef __KERNEL__
-# include <linux/module.h>
-# include <linux/pagemap.h>
-# include <linux/miscdevice.h>
-# include <linux/init.h>
-# include <linux/utsname.h>
-#else
-# include <liblustre.h>
-#endif
+#include <linux/module.h>
+#include <linux/pagemap.h>
+#include <linux/miscdevice.h>
+#include <linux/init.h>
+#include <linux/utsname.h>
#include <lustre_acl.h>
#include <lustre_ioctl.h>
RETURN(-EPROTO);
acl = posix_acl_from_xattr(&init_user_ns, buf, body->mbo_aclsize);
+ if (acl == NULL)
+ RETURN(0);
if (IS_ERR(acl)) {
rc = PTR_ERR(acl);
CERROR("convert xattr to acl: %d\n", rc);
RETURN(0);
}
-#ifdef __KERNEL__
static void mdc_release_page(struct page *page, int remove)
{
if (remove) {
kunmap(pages[i]);
}
- LASSERTF(lu_pgs == 0, "left = %d", lu_pgs);
+ LASSERTF(lu_pgs == 0, "left = %d\n", lu_pgs);
}
#else
#define mdc_adjust_dirpages(pages, cfs_pgs, lu_pgs) do {} while (0)
goto out_unlock;
}
-#else /* __KERNEL__ */
-
-static struct page
-*mdc_read_page_remote(struct obd_export *exp, const struct lmv_oinfo *lmo,
- const __u64 hash, struct obd_capa *oc)
-{
- struct ptlrpc_request *req = NULL;
- struct page *page;
- int rc;
-
- OBD_PAGE_ALLOC(page, 0);
- if (page == NULL)
- return ERR_PTR(-ENOMEM);
-
- rc = mdc_getpage(exp, &lmo->lmo_fid, hash, oc, &page, 1, &req);
- if (req != NULL)
- ptlrpc_req_finished(req);
-
- if (unlikely(rc)) {
- OBD_PAGE_FREE(page);
- return ERR_PTR(rc);
- }
- return page;
-}
-
-
-static int mdc_read_page(struct obd_export *exp, struct md_op_data *op_data,
- struct md_callback *cb_op, __u64 hash_offset,
- struct page **ppage)
-{
- struct page *page;
- struct lmv_oinfo *lmo;
- int rc = 0;
-
- /* No local cache for liblustre, always read entry remotely */
- lmo = &op_data->op_mea1->lsm_md_oinfo[op_data->op_stripe_offset];
- page = mdc_read_page_remote(exp, lmo, hash_offset,
- op_data->op_capa1);
- if (IS_ERR(page))
- return PTR_ERR(page);
-
- *ppage = page;
-
- return rc;
-}
-
-#endif
static int mdc_statfs(const struct lu_env *env,
struct obd_export *exp, struct obd_statfs *osfs,
ENTRY;
if (!try_module_get(THIS_MODULE)) {
- CERROR("Can't get module. Is it alive?");
+ CERROR("%s: cannot get module '%s'\n", obd->obd_name,
+ module_name(THIS_MODULE));
return -EINVAL;
}
switch (cmd) {
LUSTRE_MDC_NAME, NULL);
}
-#ifdef __KERNEL__
static void /*__exit*/ mdc_exit(void)
{
class_unregister_type(LUSTRE_MDC_NAME);
module_init(mdc_init);
module_exit(mdc_exit);
-#endif