25
25
#include "netns.h"
26
26
#include "pnfs.h"
27
27
#include "filecache.h"
28
+ #include "trace.h"
28
29
29
30
/*
30
31
* We have a single directory with several nodes in it.
@@ -230,6 +231,7 @@ static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size)
230
231
if (rpc_pton (net , fo_path , size , sap , salen ) == 0 )
231
232
return - EINVAL ;
232
233
234
+ trace_nfsd_ctl_unlock_ip (net , buf );
233
235
return nlmsvc_unlock_all_by_ip (sap );
234
236
}
235
237
@@ -263,7 +265,7 @@ static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size)
263
265
fo_path = buf ;
264
266
if (qword_get (& buf , fo_path , size ) < 0 )
265
267
return - EINVAL ;
266
-
268
+ trace_nfsd_ctl_unlock_fs ( netns ( file ), fo_path );
267
269
error = kern_path (fo_path , 0 , & path );
268
270
if (error )
269
271
return error ;
@@ -341,6 +343,8 @@ static ssize_t write_filehandle(struct file *file, char *buf, size_t size)
341
343
if (qword_get (& mesg , mesg , size ) > 0 )
342
344
return - EINVAL ;
343
345
346
+ trace_nfsd_ctl_filehandle (netns (file ), dname , path , maxsize );
347
+
344
348
/* we have all the words, they are in buf.. */
345
349
dom = unix_domain_find (dname );
346
350
if (!dom )
@@ -399,6 +403,7 @@ static ssize_t write_threads(struct file *file, char *buf, size_t size)
399
403
return rv ;
400
404
if (newthreads < 0 )
401
405
return - EINVAL ;
406
+ trace_nfsd_ctl_threads (net , newthreads );
402
407
rv = nfsd_svc (newthreads , net , file -> f_cred );
403
408
if (rv < 0 )
404
409
return rv ;
@@ -471,6 +476,7 @@ static ssize_t write_pool_threads(struct file *file, char *buf, size_t size)
471
476
rv = - EINVAL ;
472
477
if (nthreads [i ] < 0 )
473
478
goto out_free ;
479
+ trace_nfsd_ctl_pool_threads (net , i , nthreads [i ]);
474
480
}
475
481
rv = nfsd_set_nrthreads (i , nthreads , net );
476
482
if (rv )
@@ -536,6 +542,7 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
536
542
if (buf [size - 1 ] != '\n' )
537
543
return - EINVAL ;
538
544
buf [size - 1 ] = 0 ;
545
+ trace_nfsd_ctl_version (netns (file ), buf );
539
546
540
547
vers = mesg ;
541
548
len = qword_get (& mesg , vers , size );
@@ -689,6 +696,7 @@ static ssize_t __write_ports_addfd(char *buf, struct net *net, const struct cred
689
696
err = get_int (& mesg , & fd );
690
697
if (err != 0 || fd < 0 )
691
698
return - EINVAL ;
699
+ trace_nfsd_ctl_ports_addfd (net , fd );
692
700
693
701
err = nfsd_create_serv (net );
694
702
if (err != 0 )
@@ -720,6 +728,7 @@ static ssize_t __write_ports_addxprt(char *buf, struct net *net, const struct cr
720
728
721
729
if (port < 1 || port > USHRT_MAX )
722
730
return - EINVAL ;
731
+ trace_nfsd_ctl_ports_addxprt (net , transport , port );
723
732
724
733
err = nfsd_create_serv (net );
725
734
if (err != 0 )
@@ -853,6 +862,8 @@ static ssize_t write_maxblksize(struct file *file, char *buf, size_t size)
853
862
int rv = get_int (& mesg , & bsize );
854
863
if (rv )
855
864
return rv ;
865
+ trace_nfsd_ctl_maxblksize (netns (file ), bsize );
866
+
856
867
/* force bsize into allowed range and
857
868
* required alignment.
858
869
*/
@@ -903,6 +914,7 @@ static ssize_t write_maxconn(struct file *file, char *buf, size_t size)
903
914
904
915
if (rv )
905
916
return rv ;
917
+ trace_nfsd_ctl_maxconn (netns (file ), maxconn );
906
918
nn -> max_connections = maxconn ;
907
919
}
908
920
@@ -913,6 +925,7 @@ static ssize_t write_maxconn(struct file *file, char *buf, size_t size)
913
925
static ssize_t __nfsd4_write_time (struct file * file , char * buf , size_t size ,
914
926
time64_t * time , struct nfsd_net * nn )
915
927
{
928
+ struct dentry * dentry = file_dentry (file );
916
929
char * mesg = buf ;
917
930
int rv , i ;
918
931
@@ -922,6 +935,9 @@ static ssize_t __nfsd4_write_time(struct file *file, char *buf, size_t size,
922
935
rv = get_int (& mesg , & i );
923
936
if (rv )
924
937
return rv ;
938
+ trace_nfsd_ctl_time (netns (file ), dentry -> d_name .name ,
939
+ dentry -> d_name .len , i );
940
+
925
941
/*
926
942
* Some sanity checking. We don't have a reason for
927
943
* these particular numbers, but problems with the
@@ -1014,6 +1030,7 @@ static ssize_t __write_recoverydir(struct file *file, char *buf, size_t size,
1014
1030
len = qword_get (& mesg , recdir , size );
1015
1031
if (len <= 0 )
1016
1032
return - EINVAL ;
1033
+ trace_nfsd_ctl_recoverydir (netns (file ), recdir );
1017
1034
1018
1035
status = nfs4_reset_recoverydir (recdir );
1019
1036
if (status )
@@ -1087,7 +1104,7 @@ static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size)
1087
1104
case '1' :
1088
1105
if (!nn -> nfsd_serv )
1089
1106
return - EBUSY ;
1090
- nfsd4_end_grace ( nn );
1107
+ trace_nfsd_end_grace ( netns ( file ) );
1091
1108
break ;
1092
1109
default :
1093
1110
return - EINVAL ;
@@ -1192,8 +1209,8 @@ static int __nfsd_symlink(struct inode *dir, struct dentry *dentry,
1192
1209
* @content is assumed to be a NUL-terminated string that lives
1193
1210
* longer than the symlink itself.
1194
1211
*/
1195
- static void nfsd_symlink (struct dentry * parent , const char * name ,
1196
- const char * content )
1212
+ static void _nfsd_symlink (struct dentry * parent , const char * name ,
1213
+ const char * content )
1197
1214
{
1198
1215
struct inode * dir = parent -> d_inode ;
1199
1216
struct dentry * dentry ;
@@ -1210,8 +1227,8 @@ static void nfsd_symlink(struct dentry *parent, const char *name,
1210
1227
inode_unlock (dir );
1211
1228
}
1212
1229
#else
1213
- static inline void nfsd_symlink (struct dentry * parent , const char * name ,
1214
- const char * content )
1230
+ static inline void _nfsd_symlink (struct dentry * parent , const char * name ,
1231
+ const char * content )
1215
1232
{
1216
1233
}
1217
1234
@@ -1389,8 +1406,8 @@ static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc)
1389
1406
ret = simple_fill_super (sb , 0x6e667364 , nfsd_files );
1390
1407
if (ret )
1391
1408
return ret ;
1392
- nfsd_symlink (sb -> s_root , "supported_krb5_enctypes" ,
1393
- "/proc/net/rpc/gss_krb5_enctypes" );
1409
+ _nfsd_symlink (sb -> s_root , "supported_krb5_enctypes" ,
1410
+ "/proc/net/rpc/gss_krb5_enctypes" );
1394
1411
dentry = nfsd_mkdir (sb -> s_root , NULL , "clients" );
1395
1412
if (IS_ERR (dentry ))
1396
1413
return PTR_ERR (dentry );
0 commit comments