MCPcopy Create free account
hub / github.com/apache/cloudberry / if

Function if

src/backend/replication/basebackup.c:1646–1689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1644#endif /* HAVE_READLINK */
1645 }
1646 else if (S_ISDIR(statbuf.st_mode))
1647 {
1648 bool skip_this_dir = false;
1649 ListCell *lc;
1650
1651 /*
1652 * Store a directory entry in the tar file so we can get the
1653 * permissions right.
1654 */
1655 size += _tarWriteHeader(pathbuf + basepathlen + 1, NULL, &statbuf,
1656 sizeonly);
1657
1658 /*
1659 * Call ourselves recursively for a directory, unless it happens
1660 * to be a separate tablespace located within PGDATA.
1661 */
1662 foreach(lc, tablespaces)
1663 {
1664 tablespaceinfo *ti = (tablespaceinfo *) lfirst(lc);
1665
1666 /*
1667 * ti->rpath is the tablespace relative path within PGDATA, or
1668 * NULL if the tablespace has been properly located somewhere
1669 * else.
1670 *
1671 * Skip past the leading "./" in pathbuf when comparing.
1672 */
1673 if (ti->rpath && strcmp(ti->rpath, pathbuf + 2) == 0)
1674 {
1675 skip_this_dir = true;
1676 break;
1677 }
1678 }
1679
1680 /*
1681 * skip sending directories inside pg_tblspc, if not required.
1682 */
1683 if (strcmp(pathbuf, "./pg_tblspc") == 0 && !sendtblspclinks)
1684 skip_this_dir = true;
1685
1686 if (!skip_this_dir)
1687 size += sendDir(pathbuf, basepathlen, sizeonly, tablespaces,
1688 sendtblspclinks, manifest, spcoid, exclude);
1689 }
1690 else if (S_ISREG(statbuf.st_mode))
1691 {
1692 bool sent = false;

Callers

nothing calls this directly

Calls 5

sendDirFunction · 0.85
sendFileFunction · 0.85
tarPaddingBytesRequiredFunction · 0.85
_tarWriteHeaderFunction · 0.70
foreachFunction · 0.50

Tested by

no test coverage detected