summaryrefslogtreecommitdiff
path: root/source4/torture/raw/oplock.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-10 12:14:53 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-10 12:14:53 +1000
commita11bb148f7cdef7ec58ca79393938e7085f5b540 (patch)
treeb48b4c5620a76b750491eab70b7a12f7386bf875 /source4/torture/raw/oplock.c
parent3adbbaee3b613725516a8855d8cd460db56ecf1a (diff)
downloadsamba-a11bb148f7cdef7ec58ca79393938e7085f5b540.tar.gz
samba-a11bb148f7cdef7ec58ca79393938e7085f5b540.tar.bz2
samba-a11bb148f7cdef7ec58ca79393938e7085f5b540.zip
s4/torture: don't mix declarations and code
Diffstat (limited to 'source4/torture/raw/oplock.c')
-rw-r--r--source4/torture/raw/oplock.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index d512cb33fe..1eaa7e214b 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -2880,6 +2880,28 @@ static bool test_raw_oplock_stream1(struct torture_context *tctx,
NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK | NTCREATEX_FLAGS_EXTENDED;
uint32_t exclusive_req = NTCREATEX_FLAGS_REQUEST_OPLOCK |
NTCREATEX_FLAGS_EXTENDED;
+ /* Try some permutations of taking oplocks on streams. */
+#define NSTREAM_OPLOCK_RESULTS 8
+ struct {
+ const char *fname;
+ bool open_base_file;
+ uint32_t oplock_req;
+ uint32_t oplock_granted;
+ } stream_oplock_results[NSTREAM_OPLOCK_RESULTS] = {
+ /* Request oplock on stream without the base file open. */
+ {fname_stream, false, batch_req, NO_OPLOCK_RETURN},
+ {fname_default_stream, false, batch_req, NO_OPLOCK_RETURN},
+ {fname_stream, false, exclusive_req, EXCLUSIVE_OPLOCK_RETURN},
+ {fname_default_stream, false, exclusive_req, EXCLUSIVE_OPLOCK_RETURN},
+
+ /* Request oplock on stream with the base file open. */
+ {fname_stream, true, batch_req, NO_OPLOCK_RETURN},
+ {fname_default_stream, true, batch_req, NO_OPLOCK_RETURN},
+ {fname_stream, true, exclusive_req, EXCLUSIVE_OPLOCK_RETURN},
+ {fname_default_stream, true, exclusive_req, LEVEL_II_OPLOCK_RETURN},
+
+ };
+
/* Only passes against windows at the moment. */
if (torture_setting_bool(tctx, "samba3", false) ||
@@ -2923,28 +2945,6 @@ static bool test_raw_oplock_stream1(struct torture_context *tctx,
/* Change the disposition to open now that the file has been created. */
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
- /* Try some permutations of taking oplocks on streams. */
-#define NSTREAM_OPLOCK_RESULTS 8
- struct {
- const char *fname;
- bool open_base_file;
- uint32_t oplock_req;
- uint32_t oplock_granted;
- } stream_oplock_results[NSTREAM_OPLOCK_RESULTS] = {
- /* Request oplock on stream without the base file open. */
- {fname_stream, false, batch_req, NO_OPLOCK_RETURN},
- {fname_default_stream, false, batch_req, NO_OPLOCK_RETURN},
- {fname_stream, false, exclusive_req, EXCLUSIVE_OPLOCK_RETURN},
- {fname_default_stream, false, exclusive_req, EXCLUSIVE_OPLOCK_RETURN},
-
- /* Request oplock on stream with the base file open. */
- {fname_stream, true, batch_req, NO_OPLOCK_RETURN},
- {fname_default_stream, true, batch_req, NO_OPLOCK_RETURN},
- {fname_stream, true, exclusive_req, EXCLUSIVE_OPLOCK_RETURN},
- {fname_default_stream, true, exclusive_req, LEVEL_II_OPLOCK_RETURN},
-
- };
-
for (i = 0; i < NSTREAM_OPLOCK_RESULTS; i++) {
const char *fname = stream_oplock_results[i].fname;
bool open_base_file = stream_oplock_results[i].open_base_file;