Skip to content

Commit c282b36

Browse files
committed
More tablespace.c comment improvements.
1 parent 85fcbd8 commit c282b36

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/backend/commands/tablespace.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.69 2010/01/07 04:05:39 momjian Exp $
40+
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.70 2010/01/07 04:10:39 momjian Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -99,9 +99,8 @@ static void write_version_file(const char *path);
9999
* symlink would normally be. This isn't an exact replay of course, but
100100
* it's the best we can do given the available information.
101101
*
102-
* If tablespaces are not supported, you might think this could be a no-op,
103-
* but you'd be wrong: we still need it in case we have to re-create a
104-
* database subdirectory (of $PGDATA/base) during WAL replay.
102+
* If tablespaces are not supported, we still need it in case we have to
103+
* re-create a database subdirectory (of $PGDATA/base) during WAL replay.
105104
*/
106105
void
107106
TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
@@ -123,6 +122,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
123122

124123
if (stat(dir, &st) < 0)
125124
{
125+
/* Directory does not exist? */
126126
if (errno == ENOENT)
127127
{
128128
/*
@@ -137,7 +137,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
137137
*/
138138
if (stat(dir, &st) == 0 && S_ISDIR(st.st_mode))
139139
{
140-
/* Directory was created. */
140+
/* Directory was created */
141141
}
142142
else
143143
{
@@ -152,6 +152,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
152152
(errcode_for_file_access(),
153153
errmsg("could not create directory \"%s\": %m",
154154
dir)));
155+
155156
/* Parent directory must be missing */
156157
parentdir = pstrdup(dir);
157158
get_parent_directory(parentdir);
@@ -162,6 +163,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
162163
errmsg("could not create directory \"%s\": %m",
163164
parentdir)));
164165
pfree(parentdir);
166+
165167
/* Create database directory */
166168
if (mkdir(dir, S_IRWXU) < 0)
167169
ereport(ERROR,
@@ -252,7 +254,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
252254
* '/<dboid>/<relid>.<nnn>' (XXX but do we ever form the whole path
253255
* explicitly? This may be overly conservative.)
254256
*/
255-
if (strlen(location) >= (MAXPGPATH - 1 - OIDCHARS - 1 - OIDCHARS - 1 - OIDCHARS))
257+
if (strlen(location) >= MAXPGPATH - 1 - OIDCHARS - 1 - OIDCHARS - 1 - OIDCHARS)
256258
ereport(ERROR,
257259
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
258260
errmsg("tablespace location \"%s\" is too long",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy