*/
static int
cifs_lock_add_if(struct cifsFileInfo *cfile, struct cifsLockInfo *lock,
- bool wait)
+ bool wait, unsigned int xid)
{
struct cifsLockInfo *conf_lock;
struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
lock->type, lock->flags, &conf_lock,
CIFS_LOCK_OP);
if (!exist && cinode->can_cache_brlcks) {
+ struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
+
list_add_tail(&lock->llist, &cfile->llist->locks);
+ trace_smb3_lock_cached(xid, cfile->fid.persistent_fid,
+ tcon->tid, tcon->ses->Suid,
+ lock->offset, lock->length,
+ lock->type, 1, 0);
up_write(&cinode->lock_sem);
return rc;
}
if (!lock)
return -ENOMEM;
- rc = cifs_lock_add_if(cfile, lock, wait_flag);
+ rc = cifs_lock_add_if(cfile, lock, wait_flag, xid);
if (rc < 0) {
kfree(lock);
return rc;
smb2_set_replay(server, &rqst);
}
+ trace_smb3_lock_enter(xid, persist_fid, tcon->tid, tcon->ses->Suid,
+ le64_to_cpu(buf[0].Offset),
+ le64_to_cpu(buf[0].Length),
+ le32_to_cpu(buf[0].Flags), num_lock, 0);
+
rc = cifs_send_recv(xid, tcon->ses, server,
&rqst, &resp_buf_type, flags,
&rsp_iov);
cifs_dbg(FYI, "Send error in smb2_lockv = %d\n", rc);
cifs_stats_fail_inc(tcon, SMB2_LOCK_HE);
trace_smb3_lock_err(xid, persist_fid, tcon->tid,
- tcon->ses->Suid, rc);
+ tcon->ses->Suid,
+ le64_to_cpu(buf[0].Offset),
+ le64_to_cpu(buf[0].Length),
+ le32_to_cpu(buf[0].Flags), num_lock, rc);
+ } else {
+ trace_smb3_lock_done(xid, persist_fid, tcon->tid, tcon->ses->Suid,
+ le64_to_cpu(buf[0].Offset),
+ le64_to_cpu(buf[0].Length),
+ le32_to_cpu(buf[0].Flags), num_lock, 0);
}
if (is_replayable_error(rc) &&
TP_ARGS(xid, fid, tid, sesid, rc))
DEFINE_SMB3_FD_ERR_EVENT(flush_err);
-DEFINE_SMB3_FD_ERR_EVENT(lock_err);
DEFINE_SMB3_FD_ERR_EVENT(close_err);
+DECLARE_EVENT_CLASS(smb3_lock_class,
+ TP_PROTO(unsigned int xid,
+ __u64 fid,
+ __u32 tid,
+ __u64 sesid,
+ __u64 offset,
+ __u64 len,
+ __u32 flags,
+ __u32 num_lock,
+ int rc),
+ TP_ARGS(xid, fid, tid, sesid, offset, len, flags, num_lock, rc),
+ TP_STRUCT__entry(
+ __field(unsigned int, xid)
+ __field(__u64, fid)
+ __field(__u32, tid)
+ __field(__u64, sesid)
+ __field(__u64, offset)
+ __field(__u64, len)
+ __field(__u32, flags)
+ __field(__u32, num_lock)
+ __field(int, rc)
+ ),
+ TP_fast_assign(
+ __entry->xid = xid;
+ __entry->fid = fid;
+ __entry->tid = tid;
+ __entry->sesid = sesid;
+ __entry->offset = offset;
+ __entry->len = len;
+ __entry->flags = flags;
+ __entry->num_lock = num_lock;
+ __entry->rc = rc;
+ ),
+ TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx len=0x%llx flags=0x%x num_lock=%u rc=%d",
+ __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
+ __entry->offset, __entry->len, __entry->flags, __entry->num_lock,
+ __entry->rc)
+)
+
+#define DEFINE_SMB3_LOCK_EVENT(name) \
+DEFINE_EVENT(smb3_lock_class, smb3_##name, \
+ TP_PROTO(unsigned int xid, \
+ __u64 fid, \
+ __u32 tid, \
+ __u64 sesid, \
+ __u64 offset, \
+ __u64 len, \
+ __u32 flags, \
+ __u32 num_lock, \
+ int rc), \
+ TP_ARGS(xid, fid, tid, sesid, offset, len, flags, num_lock, rc))
+
+DEFINE_SMB3_LOCK_EVENT(lock_enter);
+DEFINE_SMB3_LOCK_EVENT(lock_done);
+DEFINE_SMB3_LOCK_EVENT(lock_err);
+DEFINE_SMB3_LOCK_EVENT(lock_cached);
+
/*
* For handle based query/set info calls
*/