On Sun, 29 Feb 2004, Anton Altaparmakov wrote:
>
> Yes but potential for using the wrong one is huge, like accidentally
> using ntfs_attr_size_set() instead of ntfs_attr_datasize_set() or
> whatever...
Supposed we chose a confusing name, compiling can indeed fail. But if we
have an easy to remember convention then this could be minimized.
> Also the header files would become quite huge
Probably over a hundred new lines must be added, sure.
> as all such functions must be inlined otherwise the speed impact would
> be unnacceptable.
An alternative is using macros as reiserfs does e.g.
#define set_sd_v2_gid(sd,n) ((sd)->sd_gid = cpu_to_le32((n)))
#define sd_v2_atime(sd) (le32_to_cpu((sd)->sd_atime))
#define set_sd_v2_atime(sd,n) ((sd)->sd_atime = cpu_to_le32((n)))
#define sd_v2_mtime(sd) (le32_to_cpu((sd)->sd_mtime))
E.g. endianess mess
reiserfsprogs ntfsprogs
headers: 127 207
code : 0 809
After a conversion ntfsprogs could have almost the same excellent metrics
as reiserfsprogs.
> The other conversion is something I am not very happy about. It is far
> too much abstraction and code obfuscation for my tastes...
The difference between the two obfuscation methods is that, now there are
obfuscations _everywhere_, and in the other case there would be _only_ in
the headers.
> So I strongly suggest to do them completely separately,
That's a good idea.
> especially as it is very likely that a flame fest will happen about
> what to call the abstracted functions
I don't things so :)
Szaka
|