| .. | .. | 
|---|
| 73 | 73 |  atomic_t rdma_stat_sq_poll; | 
|---|
| 74 | 74 |  atomic_t rdma_stat_sq_prod; | 
|---|
| 75 | 75 |   | 
|---|
| 76 |  | -struct workqueue_struct *svc_rdma_wq;  | 
|---|
| 77 |  | -  | 
|---|
| 78 | 76 |  /* | 
|---|
| 79 | 77 |   * This function implements reading and resetting an atomic_t stat | 
|---|
| 80 | 78 |   * variable through read/write to a proc file. Any write to the file | 
|---|
| .. | .. | 
|---|
| 82 | 80 |   * current value. | 
|---|
| 83 | 81 |   */ | 
|---|
| 84 | 82 |  static int read_reset_stat(struct ctl_table *table, int write, | 
|---|
| 85 |  | -			   void __user *buffer, size_t *lenp,  | 
|---|
| 86 |  | -			   loff_t *ppos)  | 
|---|
 | 83 | +			   void *buffer, size_t *lenp, loff_t *ppos)  | 
|---|
| 87 | 84 |  { | 
|---|
| 88 | 85 |  	atomic_t *stat = (atomic_t *)table->data; | 
|---|
| 89 | 86 |   | 
|---|
| .. | .. | 
|---|
| 105 | 102 |  		len -= *ppos; | 
|---|
| 106 | 103 |  		if (len > *lenp) | 
|---|
| 107 | 104 |  			len = *lenp; | 
|---|
| 108 |  | -		if (len && copy_to_user(buffer, str_buf, len))  | 
|---|
| 109 |  | -			return -EFAULT;  | 
|---|
 | 105 | +		if (len)  | 
|---|
 | 106 | +			memcpy(buffer, str_buf, len);  | 
|---|
| 110 | 107 |  		*lenp = len; | 
|---|
| 111 | 108 |  		*ppos += len; | 
|---|
| 112 | 109 |  	} | 
|---|
| .. | .. | 
|---|
| 230 | 227 |  void svc_rdma_cleanup(void) | 
|---|
| 231 | 228 |  { | 
|---|
| 232 | 229 |  	dprintk("SVCRDMA Module Removed, deregister RPC RDMA transport\n"); | 
|---|
| 233 |  | -	destroy_workqueue(svc_rdma_wq);  | 
|---|
| 234 | 230 |  	if (svcrdma_table_header) { | 
|---|
| 235 | 231 |  		unregister_sysctl_table(svcrdma_table_header); | 
|---|
| 236 | 232 |  		svcrdma_table_header = NULL; | 
|---|
| 237 | 233 |  	} | 
|---|
| 238 |  | -#if defined(CONFIG_SUNRPC_BACKCHANNEL)  | 
|---|
| 239 |  | -	svc_unreg_xprt_class(&svc_rdma_bc_class);  | 
|---|
| 240 |  | -#endif  | 
|---|
| 241 | 234 |  	svc_unreg_xprt_class(&svc_rdma_class); | 
|---|
| 242 | 235 |  } | 
|---|
| 243 | 236 |   | 
|---|
| .. | .. | 
|---|
| 249 | 242 |  	dprintk("\tmax_bc_requests  : %u\n", svcrdma_max_bc_requests); | 
|---|
| 250 | 243 |  	dprintk("\tmax_inline       : %d\n", svcrdma_max_req_size); | 
|---|
| 251 | 244 |   | 
|---|
| 252 |  | -	svc_rdma_wq = alloc_workqueue("svc_rdma", 0, 0);  | 
|---|
| 253 |  | -	if (!svc_rdma_wq)  | 
|---|
| 254 |  | -		return -ENOMEM;  | 
|---|
| 255 |  | -  | 
|---|
| 256 | 245 |  	if (!svcrdma_table_header) | 
|---|
| 257 | 246 |  		svcrdma_table_header = | 
|---|
| 258 | 247 |  			register_sysctl_table(svcrdma_root_table); | 
|---|
| 259 | 248 |   | 
|---|
| 260 | 249 |  	/* Register RDMA with the SVC transport switch */ | 
|---|
| 261 | 250 |  	svc_reg_xprt_class(&svc_rdma_class); | 
|---|
| 262 |  | -#if defined(CONFIG_SUNRPC_BACKCHANNEL)  | 
|---|
| 263 |  | -	svc_reg_xprt_class(&svc_rdma_bc_class);  | 
|---|
| 264 |  | -#endif  | 
|---|
| 265 | 251 |  	return 0; | 
|---|
| 266 | 252 |  } | 
|---|