#define smp_processor_id() 0
#endif
+#ifndef smp_mb
+#define smp_mb() do {} while (0)
+#endif
+
+#ifndef might_sleep_if
+#define might_sleep_if(cond) do {} while (0)
+#endif
+
+#ifndef might_sleep
+#define might_sleep() do {} while (0)
+#endif
+
+#ifndef signal_pending
+#define signal_pending(proc) 0
+#endif
+
+#ifndef MAY_EXEC
+#define MAY_EXEC 1
+#endif
+
+#ifndef MAY_WRITE
+#define MAY_WRITE 2
+#endif
+
+#ifndef MAY_READ
+#define MAY_READ 4
+#endif
+
+#ifndef MAY_APPEND
+#define MAY_APPEND 8
+#endif
+
+#ifndef FMODE_READ
+#define FMODE_READ 1
+#endif
+
+#ifndef FMODE_WRITE
+#define FMODE_WRITE 2
+#endif
+
+#ifndef FMODE_EXEC
+#define FMODE_EXEC 4
+#endif
+
+#define LBUG() \
+ do { \
+ printf("!!!LBUG at %s:%d\n", __FILE__, __LINE__); \
+ sleep(1000000); \
+ } while (0)
+
/* always adopt 2.5 definitions */
#define KERNEL_VERSION(a,b,c) ((a)*100+(b)*10+c)
#define LINUX_VERSION_CODE (2*200+5*10+0)
typedef struct {
void *cwd;
-}mm_segment_t;
+} mm_segment_t;
typedef int (read_proc_t)(char *page, char **start, off_t off,
int count, int *eof, void *data);
return ((mask & *addr) != 0);
}
+static __inline__ int test_and_set_bit(int nr, long * addr)
+{
+ int res;
+
+ res = test_bit(nr, addr);
+ set_bit(nr, addr);
+
+ return res;
+}
+
static __inline__ int ext2_set_bit(int nr, void *addr)
{
return set_bit(nr, (long*)addr);
int count;
};
+struct crypto_tfm;
+
+struct scatterlist {
+ struct page *page;
+ unsigned int offset;
+ __u32 dma_address;
+ unsigned int length;
+};
+
+struct cipher_tfm {
+ void *cit_iv;
+ unsigned int cit_ivsize;
+ __u32 cit_mode;
+ int (*cit_setkey)(struct crypto_tfm *tfm,
+ const __u8 *key, unsigned int keylen);
+ int (*cit_encrypt)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+ unsigned int nbytes);
+ int (*cit_encrypt_iv)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+ unsigned int nbytes, __u8 *iv);
+ int (*cit_decrypt)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+ unsigned int nbytes);
+ int (*cit_decrypt_iv)(struct crypto_tfm *tfm,
+ struct scatterlist *dst,
+ struct scatterlist *src,
+ unsigned int nbytes, __u8 *iv);
+ void (*cit_xor_block)(__u8 *dst, const __u8 *src);
+};
+
+struct digest_tfm {
+ void (*dit_init)(struct crypto_tfm *tfm);
+ void (*dit_update)(struct crypto_tfm *tfm,
+ struct scatterlist *sg, unsigned int nsg);
+ void (*dit_update_kernel)(struct crypto_tfm *tfm,
+ const void *data, size_t count);
+ void (*dit_final)(struct crypto_tfm *tfm, __u8 *out);
+ void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg,
+ unsigned int nsg, __u8 *out);
+ int (*dit_setkey)(struct crypto_tfm *tfm,
+ const __u8 *key, unsigned int keylen);
+#ifdef CONFIG_CRYPTO_HMAC
+ void *dit_hmac_block;
+#endif
+};
+
+struct compress_tfm {
+ int (*cot_compress)(struct crypto_tfm *tfm,
+ const __u8 *src, unsigned int slen,
+ __u8 *dst, unsigned int *dlen);
+ int (*cot_decompress)(struct crypto_tfm *tfm,
+ const __u8 *src, unsigned int slen,
+ __u8 *dst, unsigned int *dlen);
+};
+
+struct crypto_tfm {
+
+ __u32 crt_flags;
+
+ union {
+ struct cipher_tfm cipher;
+ struct digest_tfm digest;
+ struct compress_tfm compress;
+ } crt_u;
+
+ struct crypto_alg *__crt_alg;
+};
+
/* use the macro's argument to avoid unused warnings */
#define down(a) do { (void)a; } while (0)
#define up(a) do { (void)a; } while (0)
#define up_write(a) do { (void)a; } while (0)
#define sema_init(a,b) do { (void)a; } while (0)
#define init_rwsem(a) do { (void)a; } while (0)
+
#define DECLARE_MUTEX(name) \
struct semaphore name = { 1 }
+
static inline void init_MUTEX (struct semaphore *sem)
{
sema_init(sem, 1);
}
+struct rpc_pipe_msg {
+ struct list_head list;
+ void *data;
+ size_t len;
+ size_t copied;
+ int error;
+};
typedef struct {
- struct list_head sleepers;
+ struct list_head task_list;
} wait_queue_head_t;
typedef struct {
int ngroups;
gid_t *groups;
__u32 cap_effective;
+ __u32 pag;
struct fs_struct __fs;
};
#define set_current_state(foo) do { current->state = foo; } while (0)
#define init_waitqueue_entry(q,p) do { (q)->process = p; } while (0)
-#define add_wait_queue(q,p) do { list_add(&(q)->sleepers, &(p)->sleeping); } while (0)
+#define add_wait_queue(q,p) do { list_add(&(q)->task_list, &(p)->sleeping); } while (0)
#define del_wait_queue(p) do { list_del(&(p)->sleeping); } while (0)
#define remove_wait_queue(q,p) do { list_del(&(p)->sleeping); } while (0)
#define DECLARE_WAIT_QUEUE_HEAD(HEAD) \
wait_queue_head_t HEAD = { \
- .sleepers = LIST_HEAD_INIT(HEAD.sleepers) \
+ .task_list = LIST_HEAD_INIT(HEAD.task_list) \
}
-#define init_waitqueue_head(l) INIT_LIST_HEAD(&(l)->sleepers)
+#define init_waitqueue_head(l) INIT_LIST_HEAD(&(l)->task_list)
#define wake_up(l) do { int a; a++; } while (0)
#define TASK_INTERRUPTIBLE 0
#define TASK_UNINTERRUPTIBLE 1
#define atomic_read(a) ((a)->counter)
#define atomic_set(a,b) do {(a)->counter = b; } while (0)
#define atomic_dec_and_test(a) ((--((a)->counter)) == 0)
+#define atomic_dec_and_lock(a, l) atomic_dec_and_test(a)
#define atomic_inc(a) (((a)->counter)++)
#define atomic_dec(a) do { (a)->counter--; } while (0)
#define atomic_add(b,a) do {(a)->counter += b;} while (0)
static inline void portals_run_lbug_upcall(char *file, const char *fn,
const int l){}
-#define LBUG() \
- do { \
- printf("!!!LBUG at %s:%d\n", __FILE__, __LINE__); \
- sleep(1000000); \
- } while (0)
-
-
-
/* completion */
struct completion {
unsigned int done;
GKS_GET_MAC = 704,
} gks_cmd_t;
-#ifdef __KERNEL__
#define KEY_SIZE 16
#define MAC_SIZE 16
__u32 ck_type;
};
+#ifndef __KERNEL__
+struct posix_acl_entry {
+ short e_tag;
+ unsigned short e_perm;
+ unsigned int e_id;
+};
+#endif
+
struct key_perm {
uid_t kp_uid;
gid_t kp_gid;
__u32 kc_valid;
struct key_perm kc_perm;
};
-typedef int (*crypt_cb_t)(struct page *page, __u64 offset, __u64 count,
- int flags);
+typedef int (*crypt_cb_t)(struct page *page, __u64 offset,
+ __u64 count, int flags);
+
extern void lustre_swab_key_context (struct key_context *kctxt);
extern void lustre_swab_key_perms (struct key_perm *kperm);
-#endif /*for define __KERNEL*/
extern void lustre_swab_lustre_id(struct lustre_id *id);
extern void lustre_swab_lov_desc(struct lov_desc *desc);
#ifndef __LINUX_SEC_H_
#define __LINUX_SEC_H_
-//#include <linux/lustre_idl.h>
-
enum ptlrpcs_major_flavors {
PTLRPCS_FLVR_MAJOR_NULL = 0,
PTLRPCS_FLVR_MAJOR_GSS = 1,
PTLRPCS_FLVR_MINOR_NULL = 0,
PTLRPCS_FLVR_MINOR_NULL_MAX,
};
+
enum ptlrpcs_gss_minor_flavors {
PTLRPCS_FLVR_MINOR_GSS_NONE = 0,
PTLRPCS_FLVR_MINOR_GSS_KRB5 = 1,
char *ptlrpcs_flavor2name(__u32 flavor);
-#ifdef __KERNEL__
-
/* forward declaration */
struct obd_import;
struct ptlrpc_request;
struct ptlrpc_sec;
struct ptlrpc_secops;
-
typedef struct {
struct list_head list;
__u32 flavor;
int svcsec_null_exit(void);
/* capability */
+#ifdef __KERNEL__
#include <linux/crypto.h>
+#endif
#define NR_CAPAHASH 32
#define CAPA_TIMEOUT 1800 /* sec, == 30 min */
struct lustre_handle *handle);
void capa_put(struct obd_capa *ocapa, int type);
int capa_renew(struct lustre_capa *capa, int type);
-void capa_hmac(struct crypto_tfm *tfm, u8 *key, struct lustre_capa *capa);
+void capa_hmac(struct crypto_tfm *tfm, __u8 *key, struct lustre_capa *capa);
void capa_dup(void *dst, struct obd_capa *ocapa);
void capa_dup2(void *dst, struct lustre_capa *capa);
int capa_expired(struct lustre_capa *capa);
return jiffies + ((unsigned long)expiry - tv.tv_sec) * HZ;
}
-#endif /* __KERNEL__ */
-
struct mds_capa_key {
struct list_head k_list;
struct filter_capa_key {
struct list_head k_list;
-
struct lustre_capa_key k_key;
};
#include <linux/namei.h>
#include <linux/lustre_compat25.h>
#include <linux/lvfs_linux.h>
-#endif
-
-#ifdef LIBLUSTRE
-#include <lvfs_user_fs.h>
+#else
+#include <liblustre.h>
#endif
struct mds_grp_hash_entry;
oa.o_id, lli->lli_st_size);
/* truncate == punch from new size to absolute end of file */
+ /* XXX: capa is NULL here, is it correct? */
err = obd_punch(llu_i2dtexp(inode), &oa, lsm, lli->lli_st_size,
- OBD_OBJECT_EOF, NULL);
+ OBD_OBJECT_EOF, NULL, NULL);
if (err)
CERROR("obd_truncate fails (%d) ino %lu\n", err, lli->lli_st_ino);
else
_objs=`$AR -t $1`
mkdir -p $sysio_tmp
cd $sysio_tmp
- $AR -x ../$1
+ $AR -x $1
cd ..
for _lib in $_objs; do
ALL_OBJS=$ALL_OBJS"$sysio_tmp/$_lib ";
lcfg = lustre_cfg_new(LCFG_ADD_UUID, &bufs);
lcfg->lcfg_nid = nid;
lcfg->lcfg_nal = nal;
- err = class_process_config(&lcfg);
+ err = class_process_config(lcfg);
lustre_cfg_free(lcfg);
if (err < 0)
GOTO(out, err);
lustre_cfg_bufs_reset(&bufs, name);
- lustre_cfg_bufs_set_string(&bufs, 1, LUSTRE_MDC_NAME);
+ lustre_cfg_bufs_set_string(&bufs, 1, OBD_MDC_DEVICENAME);
lustre_cfg_bufs_set_string(&bufs, 2, mdc_uuid.uuid);
lcfg = lustre_cfg_new(LCFG_ATTACH, &bufs);
- err = class_process_config(&lcfg);
+ err = class_process_config(lcfg);
lustre_cfg_free(lcfg);
if (err < 0)
GOTO(out_del_uuid, err);
lustre_cfg_bufs_set_string(&bufs, 1, g_zconf_mdsname);
lustre_cfg_bufs_set_string(&bufs, 2, peer);
lcfg = lustre_cfg_new(LCFG_SETUP, &bufs);
- err = class_process_config(&lcfg);
+ err = class_process_config(lcfg);
lustre_cfg_free(lcfg);
if (err < 0)
GOTO(out_detach, err);
out_cleanup:
lustre_cfg_bufs_reset(&bufs, name);
lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs);
- err = class_process_config(&lcfg);
+ err = class_process_config(lcfg);
lustre_cfg_free(lcfg);
if (err < 0)
GOTO(out, err);
out_detach:
lustre_cfg_bufs_reset(&bufs, name);
lcfg = lustre_cfg_new(LCFG_DETACH, &bufs);
- err = class_process_config(&lcfg);
+ err = class_process_config(lcfg);
lustre_cfg_free(lcfg);
if (err < 0)
GOTO(out, err);
struct inode *llu_inode_from_lock(struct ldlm_lock *lock)
{
struct inode *inode;
- l_lock(&lock->l_resource->lr_namespace->ns_lock);
+#warning "fix l_lock() using here!"
+// l_lock(&lock->l_resource->lr_namespace->ns_lock);
if (lock->l_ast_data) {
inode = (struct inode *)lock->l_ast_data;
} else
inode = NULL;
- l_unlock(&lock->l_resource->lr_namespace->ns_lock);
+// l_unlock(&lock->l_resource->lr_namespace->ns_lock);
return inode;
}
lsm = lli->lli_smd;
stripe = llu_lock_to_stripe_offset(inode, lock);
- l_lock(&lock->l_resource->lr_namespace->ns_lock);
+#warning "fix l_lock() using here!"
+// l_lock(&lock->l_resource->lr_namespace->ns_lock);
kms = ldlm_extent_shift_kms(lock,
lsm->lsm_oinfo[stripe].loi_kms);
- l_unlock(&lock->l_resource->lr_namespace->ns_lock);
+// l_unlock(&lock->l_resource->lr_namespace->ns_lock);
if (lsm->lsm_oinfo[stripe].loi_kms != kms)
LDLM_DEBUG(lock, "updating kms from "LPU64" to "LPU64,
lsm->lsm_oinfo[stripe].loi_kms, kms);
lustre_cfg_bufs_reset(&bufs, obd->obd_name);
lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs);
- err = class_process_config(&lcfg);
+ err = class_process_config(lcfg);
if (err) {
CERROR("cleanup failed: %s\n", obd->obd_name);
}
lcfg->lcfg_command = LCFG_DETACH;
- err = class_process_config(&lcfg);
+ err = class_process_config(lcfg);
lustre_cfg_free(lcfg);
if (err) {
CERROR("detach failed: %s\n", obd->obd_name);
RETURN(0);
}
-static struct inode* llu_new_inode(struct filesys *fs,
+static struct inode *llu_new_inode(struct filesys *fs,
struct lustre_id *id)
{
struct inode *inode;
+ struct intnl_stat stat;
struct llu_inode_info *lli;
OBD_ALLOC(lli, sizeof(*lli));
memcpy(&lli->lli_id, id, sizeof(*id));
+#warning "fill @stat by desired attributes of new inode before using_sysio_i_new()"
+ memset(&stat, 0, sizeof(stat));
+ stat.st_ino = id_ino(id);
+
/* file identifier is needed by functions like _sysio_i_find() */
inode = _sysio_i_new(fs, &lli->lli_sysio_fid,
-#ifndef AUTOMOUNT_FILE_NAME
- id->li_stc.u.e3s.l3s_type & S_IFMT,
-#else
- id->li_stc.u.e3s.l3s_type, /* all of the bits! */
-#endif
- 0, 0,
- &llu_inode_ops, lli);
+ &stat, 0, &llu_inode_ops, lli);
if (!inode)
OBD_FREE(lli, sizeof(*lli));
valid |= OBD_MD_FLEASIZE;
}
ll_inode2id(&id, inode);
- rc = mdc_getattr(sbi->ll_md_exp, &id, valid, NULL, 0,
- NULL, ealen, &req);
+
+ /* XXX: capa is NULL here, is it correct? */
+ rc = mdc_getattr(sbi->ll_md_exp, &id, valid, NULL, NULL,
+ 0, ealen, NULL, &req);
if (rc) {
CERROR("failure %d inode %lu\n", rc, lli->lli_st_ino);
RETURN(-abs(rc));
RETURN(llu_glimpse_size(inode));
}
-static void copy_stat_buf(struct inode *ino, struct intnl_stat *b)
+static void copy_stat_buf_lli(struct llu_inode_info *lli,
+ struct intnl_stat *b)
{
- struct llu_inode_info *lli = llu_i2info(ino);
-
b->st_dev = lli->lli_st_dev;
b->st_ino = lli->lli_st_ino;
b->st_mode = lli->lli_st_mode;
b->st_ctime = lli->lli_st_ctime;
}
+static void copy_stat_buf(struct inode *ino, struct intnl_stat *b)
+{
+ struct llu_inode_info *lli = llu_i2info(ino);
+ copy_stat_buf_lli(lli, b);
+}
+
static int llu_iop_getattr(struct pnode *pno,
struct inode *ino,
struct intnl_stat *b)
llu_prepare_mdc_data(&op_data, inode, NULL, NULL, 0, 0);
rc = mdc_setattr(sbi->ll_md_exp, &op_data,
- attr, NULL, 0, NULL, 0, &request);
+ attr, NULL, 0, NULL, 0, NULL, 0, &request);
if (rc) {
ptlrpc_req_finished(request);
}
ll_inode2id(&id, inode);
- rc = mdc_getattr(sbi->ll_md_exp, &id,
- OBD_MD_LINKNAME, NULL, 0, NULL, symlen, request);
+
+ /* XXX: capa is NULL here, is it correct? */
+ rc = mdc_getattr(sbi->ll_md_exp, &id, OBD_MD_LINKNAME, NULL, 0,
+ 0, symlen, NULL, request);
if (rc) {
CERROR("inode %lu: rc = %d\n", lli->lli_st_ino, rc);
RETURN(rc);
CDEBUG(D_SUPER, "rootid "LPU64"\n", rootid.li_stc.u.e3s.l3s_ino);
sbi->ll_rootino = rootid.li_stc.u.e3s.l3s_ino;
- /* fetch attr of root inode */
+ /* XXX: capa is NULL here, is it correct? */
err = mdc_getattr(sbi->ll_md_exp, &rootid,
- OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, NULL, 0,
- NULL, 0, &request);
+ (OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS), NULL, 0,
+ 0, 0, NULL, &request);
if (err) {
CERROR("mdc_getattr failed for root: rc = %d\n", err);
GOTO(out_lov, err);
}
int ll_set_och_capa(struct inode *inode, struct lookup_intent *it,
- struct obd_client_handle *och)
+ struct obd_client_handle *och)
{
struct ptlrpc_request *req = LUSTRE_IT(it)->it_data;
struct ll_inode_info *lli = ll_i2info(inode);
*/
#include <liblustre.h>
-#include <linux/lvfs.h>
-
#include <linux/obd.h>
+#include <linux/lvfs.h>
#include <linux/lustre_lib.h>
/* XXX currently ctxt functions should not be used ?? */
#define DEBUG_SUBSYSTEM S_SEC
+#ifdef __KERNEL__
#include <linux/version.h>
#include <linux/fs.h>
#include <asm/unistd.h>
#include <linux/lustre_debug.h>
#include <linux/lustre_idl.h>
#include <linux/lustre_sec.h>
+#else
+#include <liblustre.h>
+#endif
+
#include <libcfs/list.h>
+#include <linux/lustre_sec.h>
kmem_cache_t *capa_cachep = NULL;
int capa_cache_init(void)
{
- int order = 0, nr_hash, i;
+ int nr_hash, i;
- capa_hash = (struct hlist_head *)
- __get_free_pages(GFP_ATOMIC, order);
+ OBD_ALLOC(capa_hash, PAGE_SIZE);
if (!capa_hash)
- panic("Cannot create capa_hash hash table");
+ return -ENOMEM;
- nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct hlist_head);
+ nr_hash = PAGE_SIZE / sizeof(struct hlist_head);
LASSERT(nr_hash > NR_CAPAHASH);
for (i = 0; i < NR_CAPAHASH; i++)
INIT_HLIST_HEAD(capa_hash + i);
- for (i =0; i < 3; i++)
+ for (i = 0; i < 3; i++)
INIT_LIST_HEAD(&capa_list[i]);
return 0;
ocapa->c_type = type;
if (type == CLIENT_CAPA) {
LASSERT(inode);
+#ifdef __KERNEL__
igrab(inode);
+#endif
ocapa->c_inode = inode;
memcpy(&ocapa->c_handle, handle, sizeof(*handle));
}
if (ocapa) {
if (atomic_dec_and_lock(&ocapa->c_refc, &capa_lock)) {
if (type == CLIENT_CAPA) {
+#ifdef __KERNEL__
iput(ocapa->c_inode);
+#endif
__capa_put(ocapa, type);
destroy_capa(ocapa);
}
return update_capa_locked(capa, type);
}
-void capa_hmac(struct crypto_tfm *tfm, u8 *key, struct lustre_capa *capa)
+void capa_hmac(struct crypto_tfm *tfm, __u8 *key, struct lustre_capa *capa)
{
int keylen = CAPA_KEY_LEN;
struct scatterlist sl = {
struct client_obd *cli = &imp->imp_obd->u.cli;
struct ost_body *body;
struct lustre_id *raw_id = obdo_id(oa);
- struct obd_capa *ocapa;
- struct lustre_capa *capa;
+ struct obd_capa *ocapa = NULL;
+ struct lustre_capa *capa = NULL;
struct obd_ioobj *ioobj;
struct niobuf_remote *niobuf;
int niocount;
#include <linux/lustre_sec.h>
#include <linux/lustre_audit.h>
#include <linux/fcntl.h>
-#include <linux/posix_acl.h>
-
#define HDR_SIZE(count) \
size_round(offsetof (struct lustre_msg, buflens[(count)]))
void lustre_assert_wire_constants(void)
{
}
+
/* for gks key rec */
void lustre_swab_key_perms(struct key_perm *kperm)
{
__swab32s(&kperm->kp_acls[i].e_id);
}
}
+
void lustre_swab_key_context (struct key_context *kctxt)
{
- __swab32s (&kctxt->kc_command);
- __swab32s (&kctxt->kc_valid); /* for use with open */
+ __swab32s(&kctxt->kc_command);
+ __swab32s(&kctxt->kc_valid); /* for use with open */
lustre_swab_key_perms(&kctxt->kc_perm);
}
#define CRYPTO_UNSPEC 0
#define CRYPTO_MAX_ALG_NAME 64
-struct scatterlist {
- struct page *page;
- unsigned int offset;
- __u32 dma_address;
- unsigned int length;
-};
-
static inline struct crypto_tfm *
crypto_alloc_tfm(const char *name, __u32 flags)
{
struct gss_sec {
struct ptlrpc_sec gs_base;
struct gss_api_mech *gs_mech;
-#ifdef __KERNEL__
spinlock_t gs_lock;
struct list_head gs_upcalls;
char *gs_pipepath;
struct dentry *gs_depipe;
-#endif
};
-#ifdef __KERNEL__
-
-static rwlock_t gss_ctx_lock = RW_LOCK_UNLOCKED;
-
struct gss_upcall_msg_data {
__u64 gum_pag;
__u32 gum_uid;
struct gss_upcall_msg_data gum_data;
};
+#ifdef __KERNEL__
+static rwlock_t gss_ctx_lock = RW_LOCK_UNLOCKED;
/**********************************************
* rpc_pipe upcall helpers *
**********************************************/
#else
/* XXX */
if (!list_empty(&gmsg->gum_base.list)) {
+ int error = gmsg->gum_base.errno;
+
CWARN("msg %p: list: %p/%p/%p, copied %d, err %d, wq %d\n",
- gmsg, &gmsg->gum_base.list,
- gmsg->gum_base.list.prev, gmsg->gum_base.list.next,
- gmsg->gum_base.copied, gmsg->gum_base.errno,
+ gmsg, &gmsg->gum_base.list, gmsg->gum_base.list.prev,
+ gmsg->gum_base.list.next, gmsg->gum_base.copied, error,
list_empty(&gmsg->gum_waitq.task_list));
LBUG();
}
}
#endif /* __KERNEL__ */
+/* this seems to be used only from userspace code */
+#ifndef __KERNEL__
/********************************************
* gss cred manipulation helpers *
********************************************/
-#if 0
static
int gss_cred_is_uptodate_ctx(struct ptlrpc_cred *cred)
{
#endif
static inline
-struct gss_cl_ctx * gss_get_ctx(struct gss_cl_ctx *ctx)
+struct gss_cl_ctx *gss_get_ctx(struct gss_cl_ctx *ctx)
{
atomic_inc(&ctx->gc_refcount);
return ctx;
}
#else /* !__KERNEL__ */
extern int lgss_handle_krb5_upcall(uid_t uid, __u32 dest_ip,
- char *obd_name,
- char *buf, int bufsize,
+ char *obd_name, char *buf, int bufsize,
int (*callback)(char*, unsigned long));
static int gss_cred_refresh(struct ptlrpc_cred *cred)
struct gss_sec *gsec;
struct gss_api_mech *mech;
struct gss_cl_ctx *ctx = NULL;
- struct vfs_cred vcred = { 0 };
ptl_nid_t peer_nid;
__u32 dest_ip;
__u32 subflavor;
int rc, gss_err;
+ struct gss_upcall_msg_data gmd = { 0 };
LASSERT(cred);
LASSERT(cred->pc_sec);
imp = cred->pc_sec->ps_import;
peer_nid = imp->imp_connection->c_peer.peer_id.nid;
dest_ip = (__u32) (peer_nid & 0xFFFFFFFF);
- subflavor = cred->pc_sec->ps_flavor.subflavor;
+ subflavor = cred->pc_sec->ps_flavor;
- if (subflavor != PTLRPC_SEC_GSS_KRB5I) {
+ if (subflavor != PTLRPCS_SUBFLVR_KRB5I) {
CERROR("unknown subflavor %u\n", subflavor);
GOTO(err_out, rc = -EINVAL);
}
gsec = container_of(cred->pc_sec, struct gss_sec, gs_base);
mech = gsec->gs_mech;
LASSERT(mech);
- rc = gss_parse_init_downcall(mech, &obj, &ctx, &vcred, &dest_ip,
+
+ rc = gss_parse_init_downcall(mech, &obj, &ctx, &gmd,
&gss_err);
if (rc || gss_err) {
CERROR("parse init downcall: rpc %d, gss 0x%x\n", rc, gss_err);
{
struct gss_sec *gsec;
struct ptlrpc_sec *sec;
+ uid_t save_uid;
+
#ifdef __KERNEL__
char *pos;
int pipepath_len;
- uid_t save_uid;
#endif
ENTRY;
return 0;
}
+#if defined __KERNEL__ && defined ENABLE_GSS
static void __exit ptlrpc_sec_exit(void)
{
svcsec_null_exit();
ptlrpcs_null_exit();
}
-
+#endif
EXPORT_SYMBOL(ptlrpcs_register);
EXPORT_SYMBOL(ptlrpcs_unregister);
${LMC} -m $config --add filesystem --filesystem $FS_MASTER || exit 1
# node 1
-${LMC} -m $config --add node --node $NODE1 || exit 1
+${LMC} -m $config --add net --node client --nid "*" --nettype $NETTYPE || exit 1
+${LMC} -m $config --add node --node $NODE1 || exit 1
${LMC} -m $config --add net --node $NODE1 --nid `h2$NIDTYPE $NODE1` \
--nettype $NETTYPE || exit 1
# node 2
${LMC} -m $config --add node --node $NODE2 || exit 1
-
${LMC} -m $config --add net --node $NODE2 --nid `h2$NIDTYPE $NODE2` \
--nettype $NETTYPE || exit 1
cmd = "mount -t lustre_lite -o osc=%s,mdc=%s,gkc=%s,mds_sec=%s,oss_sec=%s%s %s %s" % \
(self.vosc.get_name(), self.vmdc.get_name(), gkc_name, self.mds_sec,
self.oss_sec, self.clientoptions, config.config, self.path)
+ log("mount -t lustre_lite -o osc=%s,mdc=%s,gkc=%s,mds_sec=%s,oss_sec=%s%s %s %s" % \
+ (self.vosc.get_name(), self.vmdc.get_name(), gkc_name, self.mds_sec,
+ self.oss_sec, self.clientoptions, config.config, self.path))
run("mkdir", self.path)
ret, val = run(cmd)
if ret:
#include <string.h>
#include <stddef.h>
#include <sys/ioctl.h>
+#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
-#include <errno.h>
#include <dirent.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <linux/lustre_acl.h>
#include <lustre/lustre_user.h>
#include <linux/obd_lov.h>
-
#include <portals/ptlctl.h>
static void err_msg(char *fmt, ...)