99
1010#include "pnfs.h"
1111#include "netns.h"
12+ #include "trace.h"
1213
1314#define NFSDDBG_FACILITY NFSDDBG_PNFS
1415
@@ -125,6 +126,8 @@ nfsd4_free_layout_stateid(struct nfs4_stid *stid)
125126 struct nfs4_client * clp = ls -> ls_stid .sc_client ;
126127 struct nfs4_file * fp = ls -> ls_stid .sc_file ;
127128
129+ trace_layoutstate_free (& ls -> ls_stid .sc_stateid );
130+
128131 spin_lock (& clp -> cl_lock );
129132 list_del_init (& ls -> ls_perclnt );
130133 spin_unlock (& clp -> cl_lock );
@@ -215,6 +218,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,
215218 list_add (& ls -> ls_perfile , & fp -> fi_lo_states );
216219 spin_unlock (& fp -> fi_lock );
217220
221+ trace_layoutstate_alloc (& ls -> ls_stid .sc_stateid );
218222 return ls ;
219223}
220224
@@ -280,6 +284,8 @@ nfsd4_recall_file_layout(struct nfs4_layout_stateid *ls)
280284 if (list_empty (& ls -> ls_layouts ))
281285 goto out_unlock ;
282286
287+ trace_layout_recall (& ls -> ls_stid .sc_stateid );
288+
283289 atomic_inc (& ls -> ls_stid .sc_count );
284290 update_stateid (& ls -> ls_stid .sc_stateid );
285291 memcpy (& ls -> ls_recall_sid , & ls -> ls_stid .sc_stateid , sizeof (stateid_t ));
@@ -454,8 +460,10 @@ nfsd4_return_file_layouts(struct svc_rqst *rqstp,
454460 nfserr = nfsd4_preprocess_layout_stateid (rqstp , cstate , & lrp -> lr_sid ,
455461 false, lrp -> lr_layout_type ,
456462 & ls );
457- if (nfserr )
463+ if (nfserr ) {
464+ trace_layout_return_lookup_fail (& lrp -> lr_sid );
458465 return nfserr ;
466+ }
459467
460468 spin_lock (& ls -> ls_lock );
461469 list_for_each_entry_safe (lp , n , & ls -> ls_layouts , lo_perstate ) {
@@ -472,6 +480,7 @@ nfsd4_return_file_layouts(struct svc_rqst *rqstp,
472480 }
473481 lrp -> lrs_present = 1 ;
474482 } else {
483+ trace_layoutstate_unhash (& ls -> ls_stid .sc_stateid );
475484 nfs4_unhash_stid (& ls -> ls_stid );
476485 lrp -> lrs_present = 0 ;
477486 }
@@ -570,6 +579,8 @@ nfsd4_cb_layout_fail(struct nfs4_layout_stateid *ls)
570579
571580 rpc_ntop ((struct sockaddr * )& clp -> cl_addr , addr_str , sizeof (addr_str ));
572581
582+ nfsd4_cb_layout_fail (ls );
583+
573584 printk (KERN_WARNING
574585 "nfsd: client %s failed to respond to layout recall. "
575586 " Fencing..\n" , addr_str );
@@ -597,6 +608,7 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task)
597608 case 0 :
598609 return 1 ;
599610 case - NFS4ERR_NOMATCHING_LAYOUT :
611+ trace_layout_recall_done (& ls -> ls_stid .sc_stateid );
600612 task -> tk_status = 0 ;
601613 return 1 ;
602614 case - NFS4ERR_DELAY :
@@ -624,6 +636,8 @@ nfsd4_cb_layout_release(struct nfsd4_callback *cb)
624636 container_of (cb , struct nfs4_layout_stateid , ls_recall );
625637 LIST_HEAD (reaplist );
626638
639+ trace_layout_recall_release (& ls -> ls_stid .sc_stateid );
640+
627641 nfsd4_return_all_layouts (ls , & reaplist );
628642 nfsd4_free_layouts (& reaplist );
629643 nfs4_put_stid (& ls -> ls_stid );
0 commit comments