Обсуждение: Code review in dsa.c

Поиск
Список
Период
Сортировка

Code review in dsa.c

От
Zhang Mingli
Дата:
Hi, hackers

Found  some functions in dsa.c are not used anymore.

dsa_create
dsa_attach
dsa_get_handle
dsa_trim
dsa_dump

We once used dsa_create to create DSA and  it ’s all replaced by dsa_create_in_place since commit 31ae1638ce.
dsa_attach and dsa_get_handle cooperate with dsa_create.
dsa_trim and dsa_dump are introduced by DSA original commit 13df76a537 , but not used since then.

So, they are all dead codes, provide a patch to remove them.

Regards,
Zhang Mingli
Вложения

Re: Code review in dsa.c

От
Zhang Mingli
Дата:
HI,

On Jan 15, 2023, 23:43 +0800, Zhang Mingli <zmlpostgres@gmail.com>, wrote:
Hi, hackers

Found  some functions in dsa.c are not used anymore.

dsa_create
dsa_attach
dsa_get_handle
dsa_trim
dsa_dump

We once used dsa_create to create DSA and  it ’s all replaced by dsa_create_in_place since commit 31ae1638ce.
dsa_attach and dsa_get_handle cooperate with dsa_create.
dsa_trim and dsa_dump are introduced by DSA original commit 13df76a537 , but not used since then.

So, they are all dead codes, provide a patch to remove them.

Patch updated.
Forget to remove dsa_unpin in dsa.h, dsa_unpin is also not used since commit 13df76a537.
The gemel function dsa_pin is only used in pg_stat. Seems reasonable that we don’t need to call dsa_unpin in pg_stat.

Regards,
Zhang Mingli
Вложения

Re: Code review in dsa.c

От
Nathan Bossart
Дата:
On Mon, Jan 16, 2023 at 12:04:56AM +0800, Zhang Mingli wrote:
> So, they are all dead codes, provide a patch to remove them.

I am proposing a new use of dsa_create, dsa_attach, and dsa_get_handle in
https://commitfest.postgresql.org/41/4020/.  These might also be useful for
extensions, so IMHO we should keep this stuff.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



Re: Code review in dsa.c

От
Zhang Mingli
Дата:
HI,

On Jan 16, 2023, 00:10 +0800, Nathan Bossart <nathandbossart@gmail.com>, wrote:
On Mon, Jan 16, 2023 at 12:04:56AM +0800, Zhang Mingli wrote:
So, they are all dead codes, provide a patch to remove them.

I am proposing a new use of dsa_create, dsa_attach, and dsa_get_handle in
https://commitfest.postgresql.org/41/4020/. These might also be useful for
extensions, so IMHO we should keep this stuff.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
OK, thanks.

Regards,
Zhang Mingli