diff options
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r-- | source3/smbd/open.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 53f8b8e093..c28d2a39fa 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1237,19 +1237,20 @@ static void find_oplock_types(files_struct *fsp, } for (i=0; i<lck->data->num_share_modes; i++) { - if (!is_valid_share_mode_entry(&lck->data->share_modes[i])) { + struct share_mode_entry *e = &lck->data->share_modes[i]; + + if (!is_valid_share_mode_entry(e)) { continue; } - if (lck->data->share_modes[i].op_type == NO_OPLOCK && - is_stat_open(lck->data->share_modes[i].access_mask)) { + if (e->op_type == NO_OPLOCK && is_stat_open(e->access_mask)) { /* We ignore stat opens in the table - they always have NO_OPLOCK and never get or cause breaks. JRA. */ continue; } - if (BATCH_OPLOCK_TYPE(lck->data->share_modes[i].op_type)) { + if (BATCH_OPLOCK_TYPE(e->op_type)) { /* batch - can only be one. */ if (share_mode_stale_pid(lck->data, i)) { DEBUG(10, ("Found stale batch oplock\n")); @@ -1258,10 +1259,10 @@ static void find_oplock_types(files_struct *fsp, if (*pp_ex_or_batch || *pp_batch || *got_level2 || *got_no_oplock) { smb_panic("Bad batch oplock entry."); } - *pp_batch = &lck->data->share_modes[i]; + *pp_batch = e; } - if (EXCLUSIVE_OPLOCK_TYPE(lck->data->share_modes[i].op_type)) { + if (EXCLUSIVE_OPLOCK_TYPE(e->op_type)) { if (share_mode_stale_pid(lck->data, i)) { DEBUG(10, ("Found stale duplicate oplock\n")); continue; @@ -1270,10 +1271,10 @@ static void find_oplock_types(files_struct *fsp, if (*pp_ex_or_batch || *got_level2 || *got_no_oplock) { smb_panic("Bad exclusive or batch oplock entry."); } - *pp_ex_or_batch = &lck->data->share_modes[i]; + *pp_ex_or_batch = e; } - if (LEVEL_II_OPLOCK_TYPE(lck->data->share_modes[i].op_type)) { + if (LEVEL_II_OPLOCK_TYPE(e->op_type)) { if (*pp_batch || *pp_ex_or_batch) { if (share_mode_stale_pid(lck->data, i)) { DEBUG(10, ("Found stale LevelII " @@ -1285,7 +1286,7 @@ static void find_oplock_types(files_struct *fsp, *got_level2 = true; } - if (lck->data->share_modes[i].op_type == NO_OPLOCK) { + if (e->op_type == NO_OPLOCK) { if (*pp_batch || *pp_ex_or_batch) { if (share_mode_stale_pid(lck->data, i)) { DEBUG(10, ("Found stale NO_OPLOCK " |