Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFSv4.2: Clean up: Move nfs4_xdr_enc_*xattr() functions

They should be in the nfs4_xdr_enc_*() section, and not at the bottom of
the file.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Anna Schumaker and committed by
Trond Myklebust
31f1bd8f 04b4c9fb

+83 -71
+83 -71
fs/nfs/nfs42xdr.c
··· 707 707 encode_nops(&hdr); 708 708 } 709 709 710 + /* 711 + * Encode SETXATTR request 712 + */ 713 + static void nfs4_xdr_enc_setxattr(struct rpc_rqst *req, struct xdr_stream *xdr, 714 + const void *data) 715 + { 716 + const struct nfs42_setxattrargs *args = data; 717 + struct compound_hdr hdr = { 718 + .minorversion = nfs4_xdr_minorversion(&args->seq_args), 719 + }; 720 + 721 + encode_compound_hdr(xdr, req, &hdr); 722 + encode_sequence(xdr, &args->seq_args, &hdr); 723 + encode_putfh(xdr, args->fh, &hdr); 724 + encode_setxattr(xdr, args, &hdr); 725 + encode_nops(&hdr); 726 + } 727 + 728 + /* 729 + * Encode GETXATTR request 730 + */ 731 + static void nfs4_xdr_enc_getxattr(struct rpc_rqst *req, struct xdr_stream *xdr, 732 + const void *data) 733 + { 734 + const struct nfs42_getxattrargs *args = data; 735 + struct compound_hdr hdr = { 736 + .minorversion = nfs4_xdr_minorversion(&args->seq_args), 737 + }; 738 + uint32_t replen; 739 + 740 + encode_compound_hdr(xdr, req, &hdr); 741 + encode_sequence(xdr, &args->seq_args, &hdr); 742 + encode_putfh(xdr, args->fh, &hdr); 743 + replen = hdr.replen + op_decode_hdr_maxsz + 1; 744 + encode_getxattr(xdr, args->xattr_name, &hdr); 745 + 746 + rpc_prepare_reply_pages(req, args->xattr_pages, 0, args->xattr_len, 747 + replen); 748 + 749 + encode_nops(&hdr); 750 + } 751 + 752 + /* 753 + * Encode LISTXATTR request 754 + */ 755 + static void nfs4_xdr_enc_listxattrs(struct rpc_rqst *req, 756 + struct xdr_stream *xdr, const void *data) 757 + { 758 + const struct nfs42_listxattrsargs *args = data; 759 + struct compound_hdr hdr = { 760 + .minorversion = nfs4_xdr_minorversion(&args->seq_args), 761 + }; 762 + uint32_t replen; 763 + 764 + encode_compound_hdr(xdr, req, &hdr); 765 + encode_sequence(xdr, &args->seq_args, &hdr); 766 + encode_putfh(xdr, args->fh, &hdr); 767 + replen = hdr.replen + op_decode_hdr_maxsz + 2 + 1; 768 + encode_listxattrs(xdr, args, &hdr); 769 + 770 + rpc_prepare_reply_pages(req, args->xattr_pages, 0, args->count, replen); 771 + 772 + encode_nops(&hdr); 773 + } 774 + 775 + /* 776 + * Encode REMOVEXATTR request 777 + */ 778 + static void nfs4_xdr_enc_removexattr(struct rpc_rqst *req, 779 + struct xdr_stream *xdr, const void *data) 780 + { 781 + const struct nfs42_removexattrargs *args = data; 782 + struct compound_hdr hdr = { 783 + .minorversion = nfs4_xdr_minorversion(&args->seq_args), 784 + }; 785 + 786 + encode_compound_hdr(xdr, req, &hdr); 787 + encode_sequence(xdr, &args->seq_args, &hdr); 788 + encode_putfh(xdr, args->fh, &hdr); 789 + encode_removexattr(xdr, args->xattr_name, &hdr); 790 + encode_nops(&hdr); 791 + } 792 + 710 793 static int decode_allocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) 711 794 { 712 795 return decode_op_hdr(xdr, OP_ALLOCATE); ··· 1563 1480 } 1564 1481 1565 1482 #ifdef CONFIG_NFS_V4_2 1566 - static void nfs4_xdr_enc_setxattr(struct rpc_rqst *req, struct xdr_stream *xdr, 1567 - const void *data) 1568 - { 1569 - const struct nfs42_setxattrargs *args = data; 1570 - struct compound_hdr hdr = { 1571 - .minorversion = nfs4_xdr_minorversion(&args->seq_args), 1572 - }; 1573 - 1574 - encode_compound_hdr(xdr, req, &hdr); 1575 - encode_sequence(xdr, &args->seq_args, &hdr); 1576 - encode_putfh(xdr, args->fh, &hdr); 1577 - encode_setxattr(xdr, args, &hdr); 1578 - encode_nops(&hdr); 1579 - } 1580 - 1581 1483 static int nfs4_xdr_dec_setxattr(struct rpc_rqst *req, struct xdr_stream *xdr, 1582 1484 void *data) 1583 1485 { ··· 1583 1515 status = decode_setxattr(xdr, &res->cinfo); 1584 1516 out: 1585 1517 return status; 1586 - } 1587 - 1588 - static void nfs4_xdr_enc_getxattr(struct rpc_rqst *req, struct xdr_stream *xdr, 1589 - const void *data) 1590 - { 1591 - const struct nfs42_getxattrargs *args = data; 1592 - struct compound_hdr hdr = { 1593 - .minorversion = nfs4_xdr_minorversion(&args->seq_args), 1594 - }; 1595 - uint32_t replen; 1596 - 1597 - encode_compound_hdr(xdr, req, &hdr); 1598 - encode_sequence(xdr, &args->seq_args, &hdr); 1599 - encode_putfh(xdr, args->fh, &hdr); 1600 - replen = hdr.replen + op_decode_hdr_maxsz + 1; 1601 - encode_getxattr(xdr, args->xattr_name, &hdr); 1602 - 1603 - rpc_prepare_reply_pages(req, args->xattr_pages, 0, args->xattr_len, 1604 - replen); 1605 - 1606 - encode_nops(&hdr); 1607 1518 } 1608 1519 1609 1520 static int nfs4_xdr_dec_getxattr(struct rpc_rqst *rqstp, ··· 1606 1559 return status; 1607 1560 } 1608 1561 1609 - static void nfs4_xdr_enc_listxattrs(struct rpc_rqst *req, 1610 - struct xdr_stream *xdr, const void *data) 1611 - { 1612 - const struct nfs42_listxattrsargs *args = data; 1613 - struct compound_hdr hdr = { 1614 - .minorversion = nfs4_xdr_minorversion(&args->seq_args), 1615 - }; 1616 - uint32_t replen; 1617 - 1618 - encode_compound_hdr(xdr, req, &hdr); 1619 - encode_sequence(xdr, &args->seq_args, &hdr); 1620 - encode_putfh(xdr, args->fh, &hdr); 1621 - replen = hdr.replen + op_decode_hdr_maxsz + 2 + 1; 1622 - encode_listxattrs(xdr, args, &hdr); 1623 - 1624 - rpc_prepare_reply_pages(req, args->xattr_pages, 0, args->count, replen); 1625 - 1626 - encode_nops(&hdr); 1627 - } 1628 - 1629 1562 static int nfs4_xdr_dec_listxattrs(struct rpc_rqst *rqstp, 1630 1563 struct xdr_stream *xdr, void *data) 1631 1564 { ··· 1627 1600 status = decode_listxattrs(xdr, res); 1628 1601 out: 1629 1602 return status; 1630 - } 1631 - 1632 - static void nfs4_xdr_enc_removexattr(struct rpc_rqst *req, 1633 - struct xdr_stream *xdr, const void *data) 1634 - { 1635 - const struct nfs42_removexattrargs *args = data; 1636 - struct compound_hdr hdr = { 1637 - .minorversion = nfs4_xdr_minorversion(&args->seq_args), 1638 - }; 1639 - 1640 - encode_compound_hdr(xdr, req, &hdr); 1641 - encode_sequence(xdr, &args->seq_args, &hdr); 1642 - encode_putfh(xdr, args->fh, &hdr); 1643 - encode_removexattr(xdr, args->xattr_name, &hdr); 1644 - encode_nops(&hdr); 1645 1603 } 1646 1604 1647 1605 static int nfs4_xdr_dec_removexattr(struct rpc_rqst *req,