summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/include/lustre_sec.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/lustre/include/lustre_sec.h')
-rw-r--r--drivers/staging/lustre/lustre/include/lustre_sec.h128
1 files changed, 53 insertions, 75 deletions
diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h b/drivers/staging/lustre/lustre/include/lustre_sec.h
index dd1033be6bfa..01b4e6726a68 100644
--- a/drivers/staging/lustre/lustre/include/lustre_sec.h
+++ b/drivers/staging/lustre/lustre/include/lustre_sec.h
@@ -351,26 +351,23 @@ struct ptlrpc_ctx_ops {
/**
* To determine whether it's suitable to use the \a ctx for \a vcred.
*/
- int (*match) (struct ptlrpc_cli_ctx *ctx,
- struct vfs_cred *vcred);
+ int (*match)(struct ptlrpc_cli_ctx *ctx, struct vfs_cred *vcred);
/**
* To bring the \a ctx uptodate.
*/
- int (*refresh) (struct ptlrpc_cli_ctx *ctx);
+ int (*refresh)(struct ptlrpc_cli_ctx *ctx);
/**
* Validate the \a ctx.
*/
- int (*validate) (struct ptlrpc_cli_ctx *ctx);
+ int (*validate)(struct ptlrpc_cli_ctx *ctx);
/**
* Force the \a ctx to die.
*/
- void (*force_die) (struct ptlrpc_cli_ctx *ctx,
- int grace);
- int (*display) (struct ptlrpc_cli_ctx *ctx,
- char *buf, int bufsize);
+ void (*force_die)(struct ptlrpc_cli_ctx *ctx, int grace);
+ int (*display)(struct ptlrpc_cli_ctx *ctx, char *buf, int bufsize);
/**
* Sign the request message using \a ctx.
@@ -382,8 +379,7 @@ struct ptlrpc_ctx_ops {
*
* \see null_ctx_sign(), plain_ctx_sign(), gss_cli_ctx_sign().
*/
- int (*sign) (struct ptlrpc_cli_ctx *ctx,
- struct ptlrpc_request *req);
+ int (*sign)(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req);
/**
* Verify the reply message using \a ctx.
@@ -395,8 +391,7 @@ struct ptlrpc_ctx_ops {
*
* \see null_ctx_verify(), plain_ctx_verify(), gss_cli_ctx_verify().
*/
- int (*verify) (struct ptlrpc_cli_ctx *ctx,
- struct ptlrpc_request *req);
+ int (*verify)(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req);
/**
* Encrypt the request message using \a ctx.
@@ -408,8 +403,7 @@ struct ptlrpc_ctx_ops {
*
* \see gss_cli_ctx_seal().
*/
- int (*seal) (struct ptlrpc_cli_ctx *ctx,
- struct ptlrpc_request *req);
+ int (*seal)(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req);
/**
* Decrypt the reply message using \a ctx.
@@ -421,8 +415,7 @@ struct ptlrpc_ctx_ops {
*
* \see gss_cli_ctx_unseal().
*/
- int (*unseal) (struct ptlrpc_cli_ctx *ctx,
- struct ptlrpc_request *req);
+ int (*unseal)(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req);
/**
* Wrap bulk request data. This is called before wrapping RPC
@@ -444,9 +437,9 @@ struct ptlrpc_ctx_ops {
*
* \see plain_cli_wrap_bulk(), gss_cli_ctx_wrap_bulk().
*/
- int (*wrap_bulk) (struct ptlrpc_cli_ctx *ctx,
- struct ptlrpc_request *req,
- struct ptlrpc_bulk_desc *desc);
+ int (*wrap_bulk)(struct ptlrpc_cli_ctx *ctx,
+ struct ptlrpc_request *req,
+ struct ptlrpc_bulk_desc *desc);
/**
* Unwrap bulk reply data. This is called after wrapping RPC
@@ -461,9 +454,9 @@ struct ptlrpc_ctx_ops {
*
* \see plain_cli_unwrap_bulk(), gss_cli_ctx_unwrap_bulk().
*/
- int (*unwrap_bulk) (struct ptlrpc_cli_ctx *ctx,
- struct ptlrpc_request *req,
- struct ptlrpc_bulk_desc *desc);
+ int (*unwrap_bulk)(struct ptlrpc_cli_ctx *ctx,
+ struct ptlrpc_request *req,
+ struct ptlrpc_bulk_desc *desc);
};
#define PTLRPC_CTX_NEW_BIT (0) /* newly created */
@@ -515,9 +508,9 @@ struct ptlrpc_sec_cops {
*
* \see null_create_sec(), plain_create_sec(), gss_sec_create_kr().
*/
- struct ptlrpc_sec * (*create_sec) (struct obd_import *imp,
- struct ptlrpc_svc_ctx *ctx,
- struct sptlrpc_flavor *flavor);
+ struct ptlrpc_sec *(*create_sec)(struct obd_import *imp,
+ struct ptlrpc_svc_ctx *ctx,
+ struct sptlrpc_flavor *flavor);
/**
* Destructor of ptlrpc_sec. When called, refcount has been dropped
@@ -525,7 +518,7 @@ struct ptlrpc_sec_cops {
*
* \see null_destroy_sec(), plain_destroy_sec(), gss_sec_destroy_kr().
*/
- void (*destroy_sec) (struct ptlrpc_sec *sec);
+ void (*destroy_sec)(struct ptlrpc_sec *sec);
/**
* Notify that this ptlrpc_sec is going to die. Optionally, policy
@@ -534,7 +527,7 @@ struct ptlrpc_sec_cops {
*
* \see plain_kill_sec(), gss_sec_kill().
*/
- void (*kill_sec) (struct ptlrpc_sec *sec);
+ void (*kill_sec)(struct ptlrpc_sec *sec);
/**
* Given \a vcred, lookup and/or create its context. The policy module
@@ -544,10 +537,9 @@ struct ptlrpc_sec_cops {
*
* \see null_lookup_ctx(), plain_lookup_ctx(), gss_sec_lookup_ctx_kr().
*/
- struct ptlrpc_cli_ctx * (*lookup_ctx) (struct ptlrpc_sec *sec,
- struct vfs_cred *vcred,
- int create,
- int remove_dead);
+ struct ptlrpc_cli_ctx *(*lookup_ctx)(struct ptlrpc_sec *sec,
+ struct vfs_cred *vcred,
+ int create, int remove_dead);
/**
* Called then the reference of \a ctx dropped to 0. The policy module
@@ -559,9 +551,8 @@ struct ptlrpc_sec_cops {
*
* \see plain_release_ctx(), gss_sec_release_ctx_kr().
*/
- void (*release_ctx) (struct ptlrpc_sec *sec,
- struct ptlrpc_cli_ctx *ctx,
- int sync);
+ void (*release_ctx)(struct ptlrpc_sec *sec, struct ptlrpc_cli_ctx *ctx,
+ int sync);
/**
* Flush the context cache.
@@ -573,11 +564,8 @@ struct ptlrpc_sec_cops {
*
* \see plain_flush_ctx_cache(), gss_sec_flush_ctx_cache_kr().
*/
- int (*flush_ctx_cache)
- (struct ptlrpc_sec *sec,
- uid_t uid,
- int grace,
- int force);
+ int (*flush_ctx_cache)(struct ptlrpc_sec *sec, uid_t uid,
+ int grace, int force);
/**
* Called periodically by garbage collector to remove dead contexts
@@ -585,7 +573,7 @@ struct ptlrpc_sec_cops {
*
* \see gss_sec_gc_ctx_kr().
*/
- void (*gc_ctx) (struct ptlrpc_sec *sec);
+ void (*gc_ctx)(struct ptlrpc_sec *sec);
/**
* Given an context \a ctx, install a corresponding reverse service
@@ -593,9 +581,8 @@ struct ptlrpc_sec_cops {
* XXX currently it's only used by GSS module, maybe we should remove
* this from general API.
*/
- int (*install_rctx)(struct obd_import *imp,
- struct ptlrpc_sec *sec,
- struct ptlrpc_cli_ctx *ctx);
+ int (*install_rctx)(struct obd_import *imp, struct ptlrpc_sec *sec,
+ struct ptlrpc_cli_ctx *ctx);
/**
* To allocate request buffer for \a req.
@@ -608,9 +595,8 @@ struct ptlrpc_sec_cops {
*
* \see null_alloc_reqbuf(), plain_alloc_reqbuf(), gss_alloc_reqbuf().
*/
- int (*alloc_reqbuf)(struct ptlrpc_sec *sec,
- struct ptlrpc_request *req,
- int lustre_msg_size);
+ int (*alloc_reqbuf)(struct ptlrpc_sec *sec, struct ptlrpc_request *req,
+ int lustre_msg_size);
/**
* To free request buffer for \a req.
@@ -619,8 +605,7 @@ struct ptlrpc_sec_cops {
*
* \see null_free_reqbuf(), plain_free_reqbuf(), gss_free_reqbuf().
*/
- void (*free_reqbuf) (struct ptlrpc_sec *sec,
- struct ptlrpc_request *req);
+ void (*free_reqbuf)(struct ptlrpc_sec *sec, struct ptlrpc_request *req);
/**
* To allocate reply buffer for \a req.
@@ -632,9 +617,8 @@ struct ptlrpc_sec_cops {
*
* \see null_alloc_repbuf(), plain_alloc_repbuf(), gss_alloc_repbuf().
*/
- int (*alloc_repbuf)(struct ptlrpc_sec *sec,
- struct ptlrpc_request *req,
- int lustre_msg_size);
+ int (*alloc_repbuf)(struct ptlrpc_sec *sec, struct ptlrpc_request *req,
+ int lustre_msg_size);
/**
* To free reply buffer for \a req.
@@ -645,8 +629,7 @@ struct ptlrpc_sec_cops {
*
* \see null_free_repbuf(), plain_free_repbuf(), gss_free_repbuf().
*/
- void (*free_repbuf) (struct ptlrpc_sec *sec,
- struct ptlrpc_request *req);
+ void (*free_repbuf)(struct ptlrpc_sec *sec, struct ptlrpc_request *req);
/**
* To expand the request buffer of \a req, thus the \a segment in
@@ -658,15 +641,13 @@ struct ptlrpc_sec_cops {
* \see null_enlarge_reqbuf(), plain_enlarge_reqbuf(),
* gss_enlarge_reqbuf().
*/
- int (*enlarge_reqbuf)
- (struct ptlrpc_sec *sec,
- struct ptlrpc_request *req,
- int segment, int newsize);
+ int (*enlarge_reqbuf)(struct ptlrpc_sec *sec,
+ struct ptlrpc_request *req,
+ int segment, int newsize);
/*
* misc
*/
- int (*display) (struct ptlrpc_sec *sec,
- struct seq_file *seq);
+ int (*display)(struct ptlrpc_sec *sec, struct seq_file *seq);
};
/**
@@ -690,7 +671,7 @@ struct ptlrpc_sec_sops {
*
* \see null_accept(), plain_accept(), gss_svc_accept_kr().
*/
- int (*accept) (struct ptlrpc_request *req);
+ int (*accept)(struct ptlrpc_request *req);
/**
* Perform security transformation upon reply message.
@@ -702,15 +683,14 @@ struct ptlrpc_sec_sops {
*
* \see null_authorize(), plain_authorize(), gss_svc_authorize().
*/
- int (*authorize) (struct ptlrpc_request *req);
+ int (*authorize)(struct ptlrpc_request *req);
/**
* Invalidate server context \a ctx.
*
* \see gss_svc_invalidate_ctx().
*/
- void (*invalidate_ctx)
- (struct ptlrpc_svc_ctx *ctx);
+ void (*invalidate_ctx)(struct ptlrpc_svc_ctx *ctx);
/**
* Allocate a ptlrpc_reply_state.
@@ -724,28 +704,26 @@ struct ptlrpc_sec_sops {
*
* \see null_alloc_rs(), plain_alloc_rs(), gss_svc_alloc_rs().
*/
- int (*alloc_rs) (struct ptlrpc_request *req,
- int msgsize);
+ int (*alloc_rs)(struct ptlrpc_request *req, int msgsize);
/**
* Free a ptlrpc_reply_state.
*/
- void (*free_rs) (struct ptlrpc_reply_state *rs);
+ void (*free_rs)(struct ptlrpc_reply_state *rs);
/**
* Release the server context \a ctx.
*
* \see gss_svc_free_ctx().
*/
- void (*free_ctx) (struct ptlrpc_svc_ctx *ctx);
+ void (*free_ctx)(struct ptlrpc_svc_ctx *ctx);
/**
* Install a reverse context based on the server context \a ctx.
*
* \see gss_svc_install_rctx_kr().
*/
- int (*install_rctx)(struct obd_import *imp,
- struct ptlrpc_svc_ctx *ctx);
+ int (*install_rctx)(struct obd_import *imp, struct ptlrpc_svc_ctx *ctx);
/**
* Prepare buffer for incoming bulk write.
@@ -755,24 +733,24 @@ struct ptlrpc_sec_sops {
*
* \see gss_svc_prep_bulk().
*/
- int (*prep_bulk) (struct ptlrpc_request *req,
- struct ptlrpc_bulk_desc *desc);
+ int (*prep_bulk)(struct ptlrpc_request *req,
+ struct ptlrpc_bulk_desc *desc);
/**
* Unwrap the bulk write data.
*
* \see plain_svc_unwrap_bulk(), gss_svc_unwrap_bulk().
*/
- int (*unwrap_bulk) (struct ptlrpc_request *req,
- struct ptlrpc_bulk_desc *desc);
+ int (*unwrap_bulk)(struct ptlrpc_request *req,
+ struct ptlrpc_bulk_desc *desc);
/**
* Wrap the bulk read data.
*
* \see plain_svc_wrap_bulk(), gss_svc_wrap_bulk().
*/
- int (*wrap_bulk) (struct ptlrpc_request *req,
- struct ptlrpc_bulk_desc *desc);
+ int (*wrap_bulk)(struct ptlrpc_request *req,
+ struct ptlrpc_bulk_desc *desc);
};
struct ptlrpc_sec_policy {