linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Best solution for shifting DAX_ZERO_PAGE to XA_ZERO_ENTRY
@ 2020-11-09  1:15 Amy Parker
  2020-11-09  1:33 ` Darrick J. Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Amy Parker @ 2020-11-09  1:15 UTC (permalink / raw)
  To: linux-fsdevel, linux-nvdimm, Matthew Wilcox, dan.j.williams,
	Jan Kara

I've been writing a patch to migrate the defined DAX_ZERO_PAGE
to XA_ZERO_ENTRY for representing holes in files. XA_ZERO_ENTRY
is defined in include/linux/xarray.h, where it's defined using
xa_mk_internal(257). This function returns a void pointer, which
is incompatible with the bitwise arithmetic it is performed on with.

Currently, DAX_ZERO_PAGE is defined as an unsigned long,
so I considered typecasting it. Typecasting every time would be
repetitive and inefficient. I thought about making a new definition
for it which has the typecast, but this breaks the original point of
using already defined terms.

Should we go the route of adding a new definition, we might as
well just change the definition of DAX_ZERO_PAGE. This would
break the simplicity of the current DAX bit definitions:

#define DAX_LOCKED      (1UL << 0)
#define DAX_PMD               (1UL << 1)
#define DAX_ZERO_PAGE  (1UL << 2)
#define DAX_EMPTY      (1UL << 3)

Any thoughts on this, and what could be the best solution here?

Best regards,
Amy Parker
(they/them)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-27 16:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-09  1:15 Best solution for shifting DAX_ZERO_PAGE to XA_ZERO_ENTRY Amy Parker
2020-11-09  1:33 ` Darrick J. Wong
2020-11-09  1:44   ` Amy Parker
2020-11-09  1:50   ` Matthew Wilcox
2020-11-09  1:54     ` Amy Parker
2020-11-09  3:35       ` Matthew Wilcox
2020-11-27 16:41         ` Amy Parker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).