@@ -1530,72 +1530,6 @@ void xdr_set_pagelen(struct xdr_stream *xdr, unsigned int len)
1530
1530
}
1531
1531
EXPORT_SYMBOL_GPL (xdr_set_pagelen );
1532
1532
1533
- unsigned int xdr_align_data (struct xdr_stream * xdr , unsigned int offset ,
1534
- unsigned int length )
1535
- {
1536
- struct xdr_buf * buf = xdr -> buf ;
1537
- unsigned int from , bytes , len ;
1538
- unsigned int shift ;
1539
-
1540
- xdr_realign_pages (xdr );
1541
- from = xdr_page_pos (xdr );
1542
-
1543
- if (from >= buf -> page_len + buf -> tail -> iov_len )
1544
- return 0 ;
1545
- if (from + buf -> head -> iov_len >= buf -> len )
1546
- return 0 ;
1547
-
1548
- len = buf -> len - buf -> head -> iov_len ;
1549
-
1550
- /* We only shift data left! */
1551
- if (WARN_ONCE (from < offset , "SUNRPC: misaligned data src=%u dst=%u\n" ,
1552
- from , offset ))
1553
- return 0 ;
1554
- if (WARN_ONCE (offset > buf -> page_len ,
1555
- "SUNRPC: buffer overflow. offset=%u, page_len=%u\n" ,
1556
- offset , buf -> page_len ))
1557
- return 0 ;
1558
-
1559
- /* Move page data to the left */
1560
- shift = from - offset ;
1561
- xdr_buf_pages_shift_left (buf , from , len , shift );
1562
-
1563
- bytes = xdr_stream_remaining (xdr );
1564
- if (length > bytes )
1565
- length = bytes ;
1566
- bytes -= length ;
1567
-
1568
- xdr -> buf -> len -= shift ;
1569
- xdr_set_page (xdr , offset + length , bytes );
1570
- return length ;
1571
- }
1572
- EXPORT_SYMBOL_GPL (xdr_align_data );
1573
-
1574
- unsigned int xdr_expand_hole (struct xdr_stream * xdr , unsigned int offset ,
1575
- unsigned int length )
1576
- {
1577
- struct xdr_buf * buf = xdr -> buf ;
1578
- unsigned int from , to , shift ;
1579
-
1580
- xdr_realign_pages (xdr );
1581
- from = xdr_page_pos (xdr );
1582
- to = xdr_align_size (offset + length );
1583
-
1584
- /* Could the hole be behind us? */
1585
- if (to > from ) {
1586
- unsigned int buflen = buf -> len - buf -> head -> iov_len ;
1587
- shift = to - from ;
1588
- xdr_buf_try_expand (buf , shift );
1589
- xdr_buf_pages_shift_right (buf , from , buflen , shift );
1590
- xdr_set_page (xdr , to , xdr_stream_remaining (xdr ));
1591
- } else if (to != from )
1592
- xdr_align_data (xdr , to , 0 );
1593
- xdr_buf_pages_zero (buf , offset , length );
1594
-
1595
- return length ;
1596
- }
1597
- EXPORT_SYMBOL_GPL (xdr_expand_hole );
1598
-
1599
1533
/**
1600
1534
* xdr_enter_page - decode data from the XDR page
1601
1535
* @xdr: pointer to xdr_stream struct
0 commit comments