1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

create symbols for fetch lock response status

(This used to be ctdb commit d8243f474897dc65fb7286225b07bdf48b6faed0)
This commit is contained in:
Ronnie sahlberg 2007-04-17 12:42:52 +10:00
parent 11b5345afc
commit bccf3c7e8e
3 changed files with 10 additions and 5 deletions

View File

@ -775,10 +775,10 @@ int ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx,
ret = ctdb_call_recv(state, &call);
if (ret != 0) {
talloc_free(rec);
return -6;
return FETCH_LOCK_DMASTERFAILED;
}
return 0;
return FETCH_LOCK_SUCCESS;
}

View File

@ -528,13 +528,13 @@ int ctdb_client_fetch_lock(struct ctdb_db_context *ctdb_db,
ret = ctdb_ltdb_lock(ctdb_db, key);
if (ret != 0) {
printf("failed to lock ltdb record\n");
return -1;
return FETCH_LOCK_LOCKFAILED;
}
ret = ctdb_ltdb_fetch(ctdb_db, key, &header, ctdb_db, data);
if (ret != 0) {
ctdb_ltdb_unlock(ctdb_db, key);
return -2;
return FETCH_LOCK_FETCHFAILED;
}
@ -545,7 +545,7 @@ int ctdb_client_fetch_lock(struct ctdb_db_context *ctdb_db,
ret = ctdb_client_fetch_lock_recv(state, mem_ctx, key, data);
if (ret != 0) {
ctdb_ltdb_unlock(ctdb_db, key);
return -3;
return FETCH_LOCK_DMASTERFAILED;
}
}

View File

@ -182,6 +182,11 @@ int ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, TDB_DA
/*
do a fetch lock from a client to the local daemon
*/
#define FETCH_LOCK_SUCCESS 0
#define FETCH_LOCK_LOCKFAILED 1
#define FETCH_LOCK_FETCHFAILED 2
#define FETCH_LOCK_DMASTERFAILED 3
int ctdb_client_fetch_lock(struct ctdb_db_context *ctdb_db,
TALLOC_CTX *mem_ctx,
TDB_DATA key, TDB_DATA *data);