diff options
author | Volker Lendecke <vl@samba.org> | 2013-08-22 08:49:07 +0000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-09-03 17:13:52 +0200 |
commit | 94b320527eee0c7ba1d3818816e7d59cb863bf3f (patch) | |
tree | 6f93aa1636afac760b80bca6dade107ae9f1144d /source3/smbd | |
parent | 871488ac43d93eb3d971a64864f8e200a4c8dbed (diff) | |
download | samba-94b320527eee0c7ba1d3818816e7d59cb863bf3f.tar.gz samba-94b320527eee0c7ba1d3818816e7d59cb863bf3f.tar.xz samba-94b320527eee0c7ba1d3818816e7d59cb863bf3f.zip |
smbd: Simplify find_oplock_types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/smbd')
-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 " |