#ifdef HAVE_KERNEL_LOCKED
#include <linux/smp_lock.h>
#endif
+#ifdef HAVE_SELINUX_IS_ENABLED
+#include <linux/selinux.h>
+#endif
/*********** mount lookup *********/
**/
static int lustre_lwp_setup(struct lustre_cfg *lcfg, struct lustre_sb_info *lsi)
{
- struct obd_connect_data *data = NULL;
struct obd_device *obd;
char *lwpname = NULL;
char *lwpuuid = NULL;
if (rc != 0)
CERROR("%s: connect failed: rc = %d\n", lwpname, rc);
out:
- if (data != NULL)
- OBD_FREE_PTR(data);
if (lwpname != NULL)
OBD_FREE(lwpname, MTI_NAME_MAXLEN);
if (lwpuuid != NULL)
}
if (obd != NULL && (type == NULL || type->typ_refcnt == 0)) {
- int err;
-
obd->obd_force = 1;
/* obd_fail doesn't mean much on a server obd */
- err = class_manual_cleanup(obd);
- if (rc != 0)
- rc = err;
+ rc = class_manual_cleanup(obd);
}
mutex_unlock(&server_start_lock);
.statfs = server_statfs,
};
+/*
+ * Xattr support for Lustre servers
+ */
+static ssize_t lustre_getxattr(struct dentry *dentry, const char *name,
+ void *buffer, size_t size)
+{
+ if (!selinux_is_enabled())
+ return -EOPNOTSUPP;
+ return -ENODATA;
+}
+
+static int lustre_setxattr(struct dentry *dentry, const char *name,
+ const void *value, size_t size, int flags)
+{
+ return -EOPNOTSUPP;
+}
+
+static ssize_t lustre_listxattr(struct dentry *d_entry, char *name,
+ size_t size)
+{
+ return -EOPNOTSUPP;
+}
+
+const struct inode_operations server_inode_operations = {
+ .setxattr = lustre_setxattr,
+ .getxattr = lustre_getxattr,
+ .listxattr = lustre_listxattr,
+};
+
#define log2(n) ffz(~(n))
#define LUSTRE_SUPER_MAGIC 0x0BD00BD1
/* make_bad_inode(root); -- badness - can't umount */
/* apparently we need to be a directory for the mount to finish */
root->i_mode = S_IFDIR;
-
+ root->i_op = &server_inode_operations;
sb->s_root = d_make_root(root);
if (!sb->s_root) {
CERROR("%s: can't make root dentry\n", sb->s_id);
obd->obd_force = 1;
class_manual_cleanup(obd);
lsi->lsi_dt_dev = NULL;
+ RETURN(rc);
}
- /* XXX: to keep support old components relying on lsi_srv_mnt
- * we get this info from OSD just started */
LASSERT(obd->obd_lu_dev);
+ lu_device_get(obd->obd_lu_dev);
lsi->lsi_dt_dev = lu2dt_dev(obd->obd_lu_dev);
LASSERT(lsi->lsi_dt_dev);
+ /* set disk context for llog usage */
+ OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt);
+ obd->obd_lvfs_ctxt.dt = lsi->lsi_dt_dev;
+
dt_conf_get(NULL, lsi->lsi_dt_dev, &p);
lsi->lsi_srv_mnt = p.ddp_mnt;