1
0
Fork 0

staging/lustre: Get rid of ldlm_error_t typedef

Replace it with enum ldlm_error

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
hifive-unleashed-5.1
Oleg Drokin 2016-02-24 22:00:02 -05:00 committed by Greg Kroah-Hartman
parent 52c902fca8
commit d1777aa959
5 changed files with 13 additions and 13 deletions

View File

@ -69,7 +69,7 @@ struct obd_device;
/**
* LDLM non-error return states
*/
typedef enum {
enum ldlm_error {
ELDLM_OK = 0,
ELDLM_LOCK_CHANGED = 300,
@ -80,7 +80,7 @@ typedef enum {
ELDLM_NAMESPACE_EXISTS = 400,
ELDLM_BAD_NAMESPACE = 401
} ldlm_error_t;
};
/**
* LDLM namespace type.
@ -1019,7 +1019,7 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
} while (0)
typedef int (*ldlm_processing_policy)(struct ldlm_lock *lock, __u64 *flags,
int first_enq, ldlm_error_t *err,
int first_enq, enum ldlm_error *err,
struct list_head *work_list);
/**
@ -1105,7 +1105,7 @@ static inline int ldlm_res_lvbo_update(struct ldlm_resource *res,
return 0;
}
int ldlm_error2errno(ldlm_error_t error);
int ldlm_error2errno(enum ldlm_error error);
#if LUSTRE_TRACKS_LOCK_EXP_REFS
void ldlm_dump_export_locks(struct obd_export *exp);

View File

@ -133,7 +133,7 @@ ldlm_flock_destroy(struct ldlm_lock *lock, enum ldlm_mode mode, __u64 flags)
* would be collected and ASTs sent.
*/
static int ldlm_process_flock_lock(struct ldlm_lock *req, __u64 *flags,
int first_enq, ldlm_error_t *err,
int first_enq, enum ldlm_error *err,
struct list_head *work_list)
{
struct ldlm_resource *res = req->l_resource;
@ -449,7 +449,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
struct obd_import *imp = NULL;
struct ldlm_flock_wait_data fwd;
struct l_wait_info lwi;
ldlm_error_t err;
enum ldlm_error err;
int rc = 0;
CDEBUG(D_DLMTRACE, "flags: 0x%llx data: %p getlk: %p\n",

View File

@ -136,8 +136,8 @@ ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *,
enum ldlm_type type, enum ldlm_mode mode,
const struct ldlm_callback_suite *cbs,
void *data, __u32 lvb_len, enum lvb_type lvb_type);
ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
void *cookie, __u64 *flags);
enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **,
void *cookie, __u64 *flags);
void ldlm_lock_addref_internal(struct ldlm_lock *, __u32 mode);
void ldlm_lock_addref_internal_nolock(struct ldlm_lock *, __u32 mode);
void ldlm_lock_decref_internal(struct ldlm_lock *, __u32 mode);

View File

@ -733,7 +733,7 @@ enum ldlm_mode lck_compat_array[] = {
* Rather arbitrary mapping from LDLM error codes to errno values. This should
* not escape to the user level.
*/
int ldlm_error2errno(ldlm_error_t error)
int ldlm_error2errno(enum ldlm_error error)
{
int result;
@ -761,7 +761,7 @@ int ldlm_error2errno(ldlm_error_t error)
break;
default:
if (((int)error) < 0) /* cast to signed type */
result = error; /* as ldlm_error_t can be unsigned */
result = error; /* as enum ldlm_error can be unsigned */
else {
CERROR("Invalid DLM result code: %d\n", error);
result = -EPROTO;

View File

@ -1512,9 +1512,9 @@ out:
* Does not block. As a result of enqueue the lock would be put
* into granted or waiting list.
*/
ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns,
struct ldlm_lock **lockp,
void *cookie, __u64 *flags)
enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns,
struct ldlm_lock **lockp,
void *cookie, __u64 *flags)
{
struct ldlm_lock *lock = *lockp;
struct ldlm_resource *res = lock->l_resource;