summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-30 21:03:20 -0700
committerJeremy Allison <jra@samba.org>2010-04-30 21:03:20 -0700
commitf4092ecec722d7e2c04f3049630975af9e96bc07 (patch)
tree34767dbbd6dad945552c0ea60d187172ecd6394c /source3/modules
parentdffeb12f3dcb339bc258a7fbc38bbf9ec8dd928e (diff)
downloadsamba-f4092ecec722d7e2c04f3049630975af9e96bc07.tar.gz
samba-f4092ecec722d7e2c04f3049630975af9e96bc07.tar.bz2
samba-f4092ecec722d7e2c04f3049630975af9e96bc07.zip
Plumb the SMB2 front end into the blocking lock backend.
Metze, you'll probably be happier with this work as it doesn't abuse tevent in the way you dislike. This is a first cut at the code, which will need lots of testing but I'm hoping this will give people an idea of where I'm going with this. Jeremy.
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/onefs_cbrl.c54
1 files changed, 41 insertions, 13 deletions
diff --git a/source3/modules/onefs_cbrl.c b/source3/modules/onefs_cbrl.c
index 35dc4d2ed0..6d5d8c65ae 100644
--- a/source3/modules/onefs_cbrl.c
+++ b/source3/modules/onefs_cbrl.c
@@ -90,8 +90,18 @@ static void onefs_cbrl_enumerate_blq(const char *fn)
DEBUG(10, ("CBRL BLR records (%s):\n", fn));
- for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next)
- DEBUGADD(10, ("%s\n", onefs_cbrl_blr_state_str(blr)));
+ if (sconn->allow_smb2) {
+ struct smbd_smb2_request *smb2req;
+ for (smb2req = sconn->smb2.requests; smb2req; smb2req = nextreq) {
+ blr = get_pending_smb2req_blr(smb2req);
+ if (blr) {
+ DEBUGADD(10, ("%s\n", onefs_cbrl_blr_state_str(blr)));
+ }
+ }
+ } else {
+ for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next)
+ DEBUGADD(10, ("%s\n", onefs_cbrl_blr_state_str(blr)));
+ }
}
static struct blocking_lock_record *onefs_cbrl_find_blr(uint64_t id)
@@ -102,17 +112,35 @@ static struct blocking_lock_record *onefs_cbrl_find_blr(uint64_t id)
onefs_cbrl_enumerate_blq("onefs_cbrl_find_blr");
- for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next) {
- bs = (struct onefs_cbrl_blr_state *)blr->blr_private;
-
- /* We don't control all of the BLRs on the BLQ. */
- if (bs == NULL)
- continue;
-
- if (bs->id == id) {
- DEBUG(10, ("found %s\n",
- onefs_cbrl_blr_state_str(blr)));
- break;
+ if (sconn->allow_smb2) {
+ struct smbd_smb2_request *smb2req;
+ for (smb2req = sconn->smb2.requests; smb2req; smb2req = nextreq) {
+ blr = get_pending_smb2req_blr(smb2req);
+ if (!blr) {
+ continue;
+ }
+ bs = (struct onefs_cbrl_blr_state *)blr->blr_private;
+ if (bs == NULL) {
+ continue;
+ }
+ if (bs->id == id) {
+ DEBUG(10, ("found %s\n",
+ onefs_cbrl_blr_state_str(blr)));
+ break;
+ }
+ } else {
+ for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next) {
+ bs = (struct onefs_cbrl_blr_state *)blr->blr_private;
+
+ /* We don't control all of the BLRs on the BLQ. */
+ if (bs == NULL)
+ continue;
+
+ if (bs->id == id) {
+ DEBUG(10, ("found %s\n",
+ onefs_cbrl_blr_state_str(blr)));
+ break;
+ }
}
}