From: Junio C Hamano <hidden> Date: 2016-06-15 23:03:21
Johannes Schindelin [off-list ref] writes:
And *still*, this is *just* a global table with defaults. I would *still*
need to copy-on-write when the first customization of the severity level
takes place because I cannot allow the global defaults to be modified by
one caller (that would defeat the whole purpose of having per-caller
settings bundled in the fsck_options struct).
If you allocate a per-invocation fsck_options struct, then the
initialization the default with code is dead easy---you can just do
it immediately after you x[cm]alloc()---no?
What am I missing?
From: Johannes Schindelin <hidden> Date: 2016-06-15 23:03:21
Hi Junio,
On Tue, 23 Dec 2014, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
And *still*, this is *just* a global table with defaults. I would *still*
need to copy-on-write when the first customization of the severity level
takes place because I cannot allow the global defaults to be modified by
one caller (that would defeat the whole purpose of having per-caller
settings bundled in the fsck_options struct).
If you allocate a per-invocation fsck_options struct, then the
initialization the default with code is dead easy---you can just do
it immediately after you x[cm]alloc()---no?
There is no alloc. Right now, the initialization reads:
struct fsck_options options = strict ?
FSCK_OPTIONS_STRICT : FSCK_OPTIONS_DEFAULT;
Ciao,
Dscho
From: Junio C Hamano <hidden> Date: 2016-06-15 23:03:21
On Tue, Dec 23, 2014 at 9:28 AM, Johannes Schindelin
[off-list ref] wrote:
quoted
Johannes Schindelin [off-list ref] writes:
quoted
And *still*, this is *just* a global table with defaults. I would *still*
need to copy-on-write when the first customization of the severity level
takes place because I cannot allow the global defaults to be modified by
one caller (that would defeat the whole purpose of having per-caller
settings bundled in the fsck_options struct).
There is no alloc. Right now, the initialization reads:
struct fsck_options options = strict ?
FSCK_OPTIONS_STRICT : FSCK_OPTIONS_DEFAULT;
Then it is just the matter of having
fsck_options_init(&options);
if (strict)
options.some_field = make_it_strict;
as the first few statements, no?
I am not sure why it is so difficult....
From: Johannes Schindelin <hidden> Date: 2016-06-15 23:03:21
Hi Junio,
On Tue, 23 Dec 2014, Junio C Hamano wrote:
On Tue, Dec 23, 2014 at 9:28 AM, Johannes Schindelin
[off-list ref] wrote:
quoted
quoted
Johannes Schindelin [off-list ref] writes:
quoted
And *still*, this is *just* a global table with defaults. I would *still*
need to copy-on-write when the first customization of the severity level
takes place because I cannot allow the global defaults to be modified by
one caller (that would defeat the whole purpose of having per-caller
settings bundled in the fsck_options struct).
There is no alloc. Right now, the initialization reads:
struct fsck_options options = strict ?
FSCK_OPTIONS_STRICT : FSCK_OPTIONS_DEFAULT;
Then it is just the matter of having
fsck_options_init(&options);
if (strict)
options.some_field = make_it_strict;
as the first few statements, no?
I am not sure why it is so difficult....
It is not difficult. But I try to avoid complexity when I can. Since you
asked specifically, I will introduce it, though. Hopefully still this year
(I'll not be available for a while starting tomorrow).
Ciao,
Dscho