From: Alexandra Ellwood Date: Thu, 7 Jun 2007 21:47:38 +0000 (+0000) Subject: Removed unused locking code X-Git-Tag: krb5-1.7-alpha1~1094 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c349b8456b511265ae6c84e40b6f275fe7acdb2;p=krb5.git Removed unused locking code git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19570 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ccapi/server/ccs_lock_state.c b/src/ccapi/server/ccs_lock_state.c index 6276306bc..c90311f74 100644 --- a/src/ccapi/server/ccs_lock_state.c +++ b/src/ccapi/server/ccs_lock_state.c @@ -91,93 +91,6 @@ cc_int32 ccs_lock_state_release (ccs_lock_state_t io_lock_state) return cci_check_error (err); } -/* ------------------------------------------------------------------------ */ - -cc_int32 ccs_lock_state_allow_read (ccs_lock_state_t in_lock_state, - ccs_pipe_t in_client_pipe, - cc_uint32 *out_allow_read) -{ - cc_int32 err = ccNoError; - cc_uint32 allow_read = 0; - - if (!in_lock_state ) { err = cci_check_error (ccErrBadParam); } - if (!ccs_pipe_valid (in_client_pipe)) { err = cci_check_error (ccErrBadParam); } - if (!out_allow_read ) { err = cci_check_error (ccErrBadParam); } - - /* A client may read if no other clients have write locks */ - - if (!err) { - cc_uint64 lock_count = in_lock_state->first_pending_lock_index; - if (lock_count == 0) { - allow_read = 1; - } else { - ccs_lock_t lock = ccs_lock_array_object_at_index (in_lock_state->locks, 0); - cc_uint32 is_read_lock; - cc_uint32 is_for_client; - - err = ccs_lock_is_read_lock (lock, &is_read_lock); - - if (!err) { - err = ccs_lock_is_for_client (lock, in_client_pipe, &is_for_client); - } - - if (!err) { - /* read locks or write lock we own */ - allow_read = (is_read_lock || is_for_client); - } - } - } - - if (!err) { - *out_allow_read = allow_read; - } - - return cci_check_error (err); -} - -/* ------------------------------------------------------------------------ */ - -cc_int32 ccs_lock_state_allow_write (ccs_lock_state_t in_lock_state, - ccs_pipe_t in_client_pipe, - cc_uint32 *out_allow_write) -{ - cc_int32 err = ccNoError; - cc_uint32 allow_write = 0; - - if (!in_lock_state ) { err = cci_check_error (ccErrBadParam); } - if (!ccs_pipe_valid (in_client_pipe)) { err = cci_check_error (ccErrBadParam); } - if (!out_allow_write ) { err = cci_check_error (ccErrBadParam); } - - /* A client may write if there are no locks or if it has a write lock */ - - if (!err) { - cc_uint64 lock_count = in_lock_state->first_pending_lock_index; - if (lock_count == 0) { - allow_write = 1; - } else { - ccs_lock_t lock = ccs_lock_array_object_at_index (in_lock_state->locks, 0); - cc_uint32 is_write_lock = 0; - cc_uint32 is_for_client = 0; - - err = ccs_lock_is_write_lock (lock, &is_write_lock); - - if (!err) { - err = ccs_lock_is_for_client (lock, in_client_pipe, &is_for_client); - } - - if (!err) { - allow_write = (is_write_lock && is_for_client); - } - } - } - - if (!err) { - *out_allow_write = allow_write; - } - - return cci_check_error (err); -} - #pragma mark - /* ------------------------------------------------------------------------ */ diff --git a/src/ccapi/server/ccs_lock_state.h b/src/ccapi/server/ccs_lock_state.h index 1918452c6..3675c9f39 100644 --- a/src/ccapi/server/ccs_lock_state.h +++ b/src/ccapi/server/ccs_lock_state.h @@ -36,14 +36,6 @@ cc_int32 ccs_lock_state_new (ccs_lock_state_t *out_lock_state, cc_int32 ccs_lock_state_release (ccs_lock_state_t io_lock_state); -cc_int32 ccs_lock_state_allow_read (ccs_lock_state_t in_lock_state, - ccs_pipe_t in_client_pipe, - cc_uint32 *out_allow_read); - -cc_int32 ccs_lock_state_allow_write (ccs_lock_state_t in_lock_state, - ccs_pipe_t in_client_pipe, - cc_uint32 *out_allow_write); - cc_int32 ccs_lock_state_add (ccs_lock_state_t io_lock_state, ccs_pipe_t in_client_pipe, ccs_pipe_t in_reply_pipe,