From 344eb08ee4e444c1fc1beac26e50c6a85b942885 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 May 2011 15:30:01 +1000 Subject: nterr: Add mem_ctx for return string from get_nt_error_c_code() It is clearer to avoid the implicit return on talloc_tos() Andrew Bartlett --- source4/ntvfs/nbench/vfs_nbench.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/nbench/vfs_nbench.c b/source4/ntvfs/nbench/vfs_nbench.c index 35cd86f34d..565f2dafed 100644 --- a/source4/ntvfs/nbench/vfs_nbench.c +++ b/source4/ntvfs/nbench/vfs_nbench.c @@ -165,10 +165,9 @@ static NTSTATUS nbench_disconnect(struct ntvfs_module_context *ntvfs) static void nbench_unlink_send(struct ntvfs_request *req) { union smb_unlink *unl = req->async_states->private_data; - nbench_log(req, "Unlink \"%s\" 0x%x %s\n", unl->unlink.in.pattern, unl->unlink.in.attrib, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -213,7 +212,7 @@ static void nbench_chkpath_send(struct ntvfs_request *req) nbench_log(req, "Chkpath \"%s\" %s\n", cp->chkpath.in.path, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -239,7 +238,7 @@ static void nbench_qpathinfo_send(struct ntvfs_request *req) nbench_log(req, "QUERY_PATH_INFORMATION \"%s\" %d %s\n", info->generic.in.file.path, info->generic.level, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -264,7 +263,7 @@ static void nbench_qfileinfo_send(struct ntvfs_request *req) nbench_log(req, "QUERY_FILE_INFORMATION %s %d %s\n", nbench_ntvfs_handle_string(req, info->generic.in.file.ntvfs), info->generic.level, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -289,7 +288,7 @@ static void nbench_setpathinfo_send(struct ntvfs_request *req) nbench_log(req, "SET_PATH_INFORMATION \"%s\" %d %s\n", st->generic.in.file.path, st->generic.level, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -321,7 +320,7 @@ static void nbench_open_send(struct ntvfs_request *req) io->ntcreatex.in.create_options, io->ntcreatex.in.open_disposition, nbench_ntvfs_handle_string(req, io->ntcreatex.out.file.ntvfs), - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; default: @@ -373,7 +372,7 @@ static void nbench_rmdir_send(struct ntvfs_request *req) nbench_log(req, "Rmdir \"%s\" %s\n", rd->in.path, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -400,7 +399,7 @@ static void nbench_rename_send(struct ntvfs_request *req) nbench_log(req, "Rename \"%s\" \"%s\" %s\n", ren->rename.in.pattern1, ren->rename.in.pattern2, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; default: @@ -459,7 +458,7 @@ static void nbench_read_send(struct ntvfs_request *req) (int)rd->readx.in.offset, rd->readx.in.maxcnt, rd->readx.out.nread, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; default: nbench_log(req, "Read-%d - NOT HANDLED\n", @@ -497,7 +496,7 @@ static void nbench_write_send(struct ntvfs_request *req) (int)wr->writex.in.offset, wr->writex.in.count, wr->writex.out.nwritten, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; case RAW_WRITE_WRITE: @@ -509,7 +508,7 @@ static void nbench_write_send(struct ntvfs_request *req) wr->write.in.offset, wr->write.in.count, wr->write.out.nwritten, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; default: @@ -563,12 +562,12 @@ static void nbench_flush_send(struct ntvfs_request *req) case RAW_FLUSH_FLUSH: nbench_log(req, "Flush %s %s\n", nbench_ntvfs_handle_string(req, io->flush.in.file.ntvfs), - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; case RAW_FLUSH_ALL: nbench_log(req, "Flush %d %s\n", 0xFFFF, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; default: nbench_log(req, "Flush-%d - NOT HANDLED\n", @@ -601,7 +600,7 @@ static void nbench_close_send(struct ntvfs_request *req) case RAW_CLOSE_CLOSE: nbench_log(req, "Close %s %s\n", nbench_ntvfs_handle_string(req, io->close.in.file.ntvfs), - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; default: @@ -718,14 +717,14 @@ static void nbench_lock_send(struct ntvfs_request *req) nbench_ntvfs_handle_string(req, lck->lockx.in.file.ntvfs), (int)lck->lockx.in.locks[0].offset, (int)lck->lockx.in.locks[0].count, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); } else if (lck->generic.level == RAW_LOCK_LOCKX && lck->lockx.in.ulock_cnt == 1) { nbench_log(req, "UnlockX %s %d %d %s\n", nbench_ntvfs_handle_string(req, lck->lockx.in.file.ntvfs), (int)lck->lockx.in.locks[0].offset, (int)lck->lockx.in.locks[0].count, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); } else { nbench_log(req, "Lock-%d - NOT HANDLED\n", lck->generic.level); } @@ -753,7 +752,7 @@ static void nbench_setfileinfo_send(struct ntvfs_request *req) nbench_log(req, "SET_FILE_INFORMATION %s %d %s\n", nbench_ntvfs_handle_string(req, info->generic.in.file.ntvfs), info->generic.level, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -778,7 +777,7 @@ static void nbench_fsinfo_send(struct ntvfs_request *req) nbench_log(req, "QUERY_FS_INFORMATION %d %s\n", fs->generic.level, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); PASS_THRU_REP_POST(req); } @@ -832,7 +831,7 @@ static void nbench_search_first_send(struct ntvfs_request *req) io->t2ffirst.data_level, io->t2ffirst.in.max_count, io->t2ffirst.out.count, - get_nt_error_c_code(req->async_states->status)); + get_nt_error_c_code(req, req->async_states->status)); break; default: -- cgit