diff options
author | Alexandra Ellwood <lxs@mit.edu> | 2007-06-07 21:47:38 +0000 |
---|---|---|
committer | Alexandra Ellwood <lxs@mit.edu> | 2007-06-07 21:47:38 +0000 |
commit | 5c349b8456b511265ae6c84e40b6f275fe7acdb2 (patch) | |
tree | 58d5f2e787462ebdb5182ea6438c5d7d76936924 | |
parent | d439fa96b8c8b72eba8cb4e258ede4a32e8999f5 (diff) | |
download | krb5-5c349b8456b511265ae6c84e40b6f275fe7acdb2.zip krb5-5c349b8456b511265ae6c84e40b6f275fe7acdb2.tar.gz krb5-5c349b8456b511265ae6c84e40b6f275fe7acdb2.tar.bz2 |
Removed unused locking code
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19570 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/ccapi/server/ccs_lock_state.c | 87 | ||||
-rw-r--r-- | src/ccapi/server/ccs_lock_state.h | 8 |
2 files changed, 0 insertions, 95 deletions
diff --git a/src/ccapi/server/ccs_lock_state.c b/src/ccapi/server/ccs_lock_state.c index 6276306..c90311f 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 1918452..3675c9f 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, |