Removed unused locking code
authorAlexandra Ellwood <lxs@mit.edu>
Thu, 7 Jun 2007 21:47:38 +0000 (21:47 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Thu, 7 Jun 2007 21:47:38 +0000 (21:47 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19570 dc483132-0cff-0310-8789-dd5450dbe970

src/ccapi/server/ccs_lock_state.c
src/ccapi/server/ccs_lock_state.h

index 6276306bc33ca1bafb2b888e36b7f6ceadcfad05..c90311f7492499399bd2740e79743d91da66899f 100644 (file)
@@ -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 -
 
 /* ------------------------------------------------------------------------ */
index 1918452c6890b5ccde4b95a4b36efdda362adb4e..3675c9f390860048f123429ab378dcb350cb6e80 100644 (file)
@@ -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,