Print this page
Build provider 3rd arg from smb_request_t
hacking...
NEX-1643 dtrace provider for smbsrv
Also illumos 1841:
 DTrace smb provider was mis-implemented, doesn't exist.
Add back handlers for read/write raw, so that
 legacy dtrace consumers can find the probes.
Kill extra arg in smb_negotiate
Fix missing "done" probe with smb_notify
Add example consumer: smb-trace.d
fix soi_pid


  98         op->op_oplock_level = SMB_OPLOCK_NONE;
  99         if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPLOCK) {
 100                 if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPBATCH)
 101                         op->op_oplock_level = SMB_OPLOCK_BATCH;
 102                 else
 103                         op->op_oplock_level = SMB_OPLOCK_EXCLUSIVE;
 104         }
 105 
 106         if (sd_len) {
 107                 status = smb_decode_sd(&xa->req_data_mb, &sd);
 108                 if (status != NT_STATUS_SUCCESS) {
 109                         smbsr_error(sr, status, 0, 0);
 110                         return (SDRC_ERROR);
 111                 }
 112                 op->sd = kmem_alloc(sizeof (smb_sd_t), KM_SLEEP);
 113                 *op->sd = sd;
 114         } else {
 115                 op->sd = NULL;
 116         }
 117 
 118         DTRACE_SMB_2(op__NtTransactCreate__start, smb_request_t *, sr,
 119             struct open_param *, op);
 120 
 121         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 122 }
 123 
 124 void
 125 smb_post_nt_transact_create(smb_request_t *sr, smb_xa_t *xa)
 126 {
 127         smb_sd_t *sd = sr->arg.open.sd;

 128 
 129         DTRACE_SMB_2(op__NtTransactCreate__done, smb_request_t *, sr,
 130             smb_xa_t *, xa);
 131 
 132         if (sd) {
 133                 smb_sd_term(sd);
 134                 kmem_free(sd, sizeof (smb_sd_t));
 135         }
 136 
 137         if (sr->arg.open.dir != NULL) {
 138                 smb_ofile_release(sr->arg.open.dir);
 139                 sr->arg.open.dir = NULL;
 140         }
 141 }
 142 
 143 /*
 144  * A lot like smb_com_nt_create_andx
 145  */
 146 smb_sdrc_t
 147 smb_nt_transact_create(smb_request_t *sr, smb_xa_t *xa)
 148 {
 149         struct open_param       *op = &sr->arg.open;
 150         smb_attr_t              *ap = &op->fqi.fq_fattr;




  98         op->op_oplock_level = SMB_OPLOCK_NONE;
  99         if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPLOCK) {
 100                 if (op->nt_flags & NT_CREATE_FLAG_REQUEST_OPBATCH)
 101                         op->op_oplock_level = SMB_OPLOCK_BATCH;
 102                 else
 103                         op->op_oplock_level = SMB_OPLOCK_EXCLUSIVE;
 104         }
 105 
 106         if (sd_len) {
 107                 status = smb_decode_sd(&xa->req_data_mb, &sd);
 108                 if (status != NT_STATUS_SUCCESS) {
 109                         smbsr_error(sr, status, 0, 0);
 110                         return (SDRC_ERROR);
 111                 }
 112                 op->sd = kmem_alloc(sizeof (smb_sd_t), KM_SLEEP);
 113                 *op->sd = sd;
 114         } else {
 115                 op->sd = NULL;
 116         }
 117 
 118         DTRACE_SMB_1(op__NtTransactCreate__start, smb_request_t *, sr); /* arg.open */

 119 
 120         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 121 }
 122 
 123 void
 124 smb_post_nt_transact_create(smb_request_t *sr, smb_xa_t *xa)
 125 {
 126         smb_sd_t *sd = sr->arg.open.sd;
 127         _NOTE(ARGUNUSED(xa))
 128 
 129         DTRACE_SMB_1(op__NtTransactCreate__done, smb_request_t *, sr);

 130 
 131         if (sd) {
 132                 smb_sd_term(sd);
 133                 kmem_free(sd, sizeof (smb_sd_t));
 134         }
 135 
 136         if (sr->arg.open.dir != NULL) {
 137                 smb_ofile_release(sr->arg.open.dir);
 138                 sr->arg.open.dir = NULL;
 139         }
 140 }
 141 
 142 /*
 143  * A lot like smb_com_nt_create_andx
 144  */
 145 smb_sdrc_t
 146 smb_nt_transact_create(smb_request_t *sr, smb_xa_t *xa)
 147 {
 148         struct open_param       *op = &sr->arg.open;
 149         smb_attr_t              *ap = &op->fqi.fq_fattr;