Skip to contentSkip to conversation

md:Remove no longer needed fix me comment in dm-region-hash.c for removing the structure pointer, *rh from the definiton of dm_region

PATCH RESEND In review Nicholas Krause 2 participants 6 messages Jan 20, 2015 – Jan 26, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 md:Remove no longer needed fix me comment in dm-region-hash.c for removing the structure pointer, *rh from the definiton of dm_region

Removes the no longer needed fix me comment questioning if we need to remove the structure pointer,rh as defined as a structure of type dsm_region_hash from the definition of the structure, dm_region. Furthermore this pointer is needed in order for various functions to run and build successfully in the file, dm-region-hash.c.

---
 drivers/md/dm-region-hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-region-hash.c +1 -1
index b929fd5..823d56f 100644
@@ -99,7 +99,7 @@ struct dm_region_hash {
 };
 
 struct dm_region {
-	struct dm_region_hash *rh;	/* FIXME: can we get rid of this ? */
+	struct dm_region_hash *rh;
 	region_t key;
 	int state;
 
Signature · 1 line
2.1.0
#1 lore raw
Quoted 5 lines · Nicholas Krause

Removes the no longer needed fix me comment questioning if we need to remove the structure pointer,rh as defined as a structure of type dsm_region_hash from the definition of the structure, dm_region. Furthermore this pointer is needed in order for various functions to run and build successfully in the file, dm-region-hash.c.

You've misunderstood the comment!
Is there a better alternative to having every dm_region struct store its own copy of this pointer?

Alasdair

author
#2 lore raw

Alasdair,
Unless we use a union or something similar there seems to be no easy way without rewriting a lot of an already function driver file. Cheers,
Nick

Quoted 13 lines · Alasdair G Kergon
Quoted 5 lines · Nicholas Krause

Removes the no longer needed fix me comment questioning if we need to remove the structure pointer,rh as defined as a structure of type dsm_region_hash from the definition of the structure, dm_region. Furthermore this pointer is needed in order for various functions to run and build successfully in the file, dm-region-hash.c.

You've misunderstood the comment!
Is there a better alternative to having every dm_region struct store its own copy of this pointer?

Alasdair

#3 lore raw
Quoted 2 lines · nick

Unless we use a union or something similar there seems to be no easy way without rewriting a lot of an already function driver file.

The comment does not restrict itself to 'easy ways'.

Alasdair

#4 lore raw
Quoted 9 lines · Alasdair G Kergon
Quoted 2 lines · nick

Unless we use a union or something similar there seems to be no easy way without rewriting a lot of an already function driver file.

The comment does not restrict itself to 'easy ways'.

Alasdair

Then I suggest that I look into this form. Sorry about wasting your time. Nick

#5 lore raw
Quoted 5 lines · Nick Krause
Quoted 4 lines · Alasdair G Kergon
Quoted 2 lines · nick

Unless we use a union or something similar there seems to be no easy way without rewriting a lot of an already function driver file.

Quoted 7 lines
Quoted 5 lines

The comment does not restrict itself to 'easy ways'.

Alasdair

Then I suggest that I look into this form. Sorry about wasting your time. Nick

Alasdir,
After thinking about this for a while, there seems to no way unless we rewrite this driver and most of the functions. This is due to lots of callers on this pointer.
Further more due to this I assume either removing the FIXME or investigating how much memory these pointers use under various workloads.
Nick