Commit 57322f3
committed
rgw/rgw_file: Move RGW{ListBuckets,Readdir}Request::eof() to .cc file
Move RGWListBucketsRequest::eof() and RGWReaddirRequest::eof()
implementations from header to rgw/rgw_file.cc for better consistency
with our custom RGWFileHandle::readdir_offset formatting.
Previously, these functions relied on boost::variant's global operator<<,
but we have our own specialized operator<< for readdir_offset in rgw_file_int.h.
Our implementation is optimized for the case where readdir_offset contains a
const char* and uses unlikely() for performance, unlike boost's default
formatter.
By moving implementations to the .cc file (after our custom operator<<
definition), we ensure they use our formatting logic and resolve potential
conflicts. This also properly addresses the fact that friend declarations
don't serve as function declarations. This change also paves the road to
migrate from boost::variant to std::variant, which does not provide the
global operator<<, so we will have to use our operator<< overload.
To preserve the previous inline behavior, both functions are explicitly
marked with the 'inline' keyword. Verification of inlining was performed
using:
```
readelf -s -W --demangle build/src/rgw/CMakeFiles/rgw_a.dir/rgw_file.cc.o | grep "Request::eof"
```
With `CMAKE_BUILD_TYPE=RelWithDebInfo`, both functions are confirmed to be
inlined as they don't appear in the symbol table, maintaining existing
behavior.
Signed-off-by: Kefu Chai <[email protected]>1 parent a372d62 commit 57322f3
2 files changed
+33
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1828 | 1859 | | |
1829 | 1860 | | |
1830 | 1861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1442 | 1442 | | |
1443 | 1443 | | |
1444 | 1444 | | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
| 1445 | + | |
1460 | 1446 | | |
1461 | 1447 | | |
1462 | 1448 | | |
| |||
1769 | 1755 | | |
1770 | 1756 | | |
1771 | 1757 | | |
1772 | | - | |
1773 | | - | |
1774 | | - | |
1775 | | - | |
1776 | | - | |
1777 | | - | |
1778 | | - | |
1779 | | - | |
1780 | | - | |
1781 | | - | |
1782 | | - | |
1783 | | - | |
1784 | | - | |
1785 | | - | |
1786 | | - | |
1787 | | - | |
| 1758 | + | |
1788 | 1759 | | |
1789 | 1760 | | |
1790 | 1761 | | |
| |||
0 commit comments