bc_svc.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /******************************************************************************
  2. (c) 2007 Network Appliance, Inc. All Rights Reserved.
  3. (c) 2009 NetApp. All Rights Reserved.
  4. NetApp provides this source code under the GPL v2 License.
  5. The GPL v2 license is available at
  6. http://opensource.org/licenses/gpl-license.php.
  7. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  8. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  9. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  11. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  12. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  13. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  14. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  15. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  16. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  17. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  18. ******************************************************************************/
  19. /*
  20. * The NFSv4.1 callback service helper routines.
  21. * They implement the transport level processing required to send the
  22. * reply over an existing open connection previously established by the client.
  23. */
  24. #if defined(CONFIG_NFS_V4_1)
  25. #include <linux/module.h>
  26. #include <linux/sunrpc/xprt.h>
  27. #include <linux/sunrpc/sched.h>
  28. #include <linux/sunrpc/bc_xprt.h>
  29. #define RPCDBG_FACILITY RPCDBG_SVCDSP
  30. /* Empty callback ops */
  31. static const struct rpc_call_ops nfs41_callback_ops = {
  32. };
  33. /*
  34. * Send the callback reply
  35. */
  36. int bc_send(struct rpc_rqst *req)
  37. {
  38. struct rpc_task *task;
  39. int ret;
  40. dprintk("RPC: bc_send req= %p\n", req);
  41. task = rpc_run_bc_task(req, &nfs41_callback_ops);
  42. if (IS_ERR(task))
  43. ret = PTR_ERR(task);
  44. else {
  45. BUG_ON(atomic_read(&task->tk_count) != 1);
  46. ret = task->tk_status;
  47. rpc_put_task(task);
  48. }
  49. dprintk("RPC: bc_send ret= %d\n", ret);
  50. return ret;
  51. }
  52. #endif /* CONFIG_NFS_V4_1 */