Skip to contentSkip to conversation

staging: lustre: remove unused variable

PATCH In review Dan Carpenter 4 participants 4 messages Nov 3, 2015 – Nov 4, 2015

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

PATCH 1/1 staging: lustre: remove unused variable

The "->lr_lvb_data" struct member is never used. Delete it.

---
I have compile tested this. I looked through the history and it seems to never have been used. I wonder if we can remove the locking as well.

drivers/staging/lustre/lustre/include/lustre_dlm.h +0 -2
index 0e75a15..138479a 100644
@@ -872,8 +872,6 @@ struct ldlm_resource {
 	 */
 	struct mutex		lr_lvb_mutex;
 	int			lr_lvb_len;
-	/** protected by lr_lock */
-	void			*lr_lvb_data;
 
 	/** When the resource was considered as contended. */
 	unsigned long		lr_contention_time;
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +0 -2
index c0a54bf..b55a4f0 100644
@@ -1154,8 +1154,6 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
 			CERROR("%s: lvbo_init failed for resource %#llx:%#llx: rc = %d\n",
 			       ns->ns_obd->obd_name, name->name[0],
 			       name->name[1], rc);
-			kfree(res->lr_lvb_data);
-			res->lr_lvb_data = NULL;
 			res->lr_lvb_len = rc;
 			mutex_unlock(&res->lr_lvb_mutex);
 			ldlm_resource_putref(res);
#1 lore raw
Quoted 7 lines

The "->lr_lvb_data" struct member is never used. Delete it.

---
I have compile tested this. I looked through the history and it seems to never have been used. I wonder if we can remove the locking as well.

This is used by the quota and ofd layer which are both server side.

#2 lore raw
Quoted 9 lines · James A.
Quoted 7 lines

The "->lr_lvb_data" struct member is never used. Delete it.

---
I have compile tested this. I looked through the history and it seems to never have been used. I wonder if we can remove the locking as well.

This is used by the quota and ofd layer which are both server side.

What does that mean here?

confused,

greg k-h

#3 lore raw
In reply to Dan Carpenter
Quoted 8 lines · James A.
Quoted 6 lines

The "->lr_lvb_data" struct member is never used. Delete it.

---
I have compile tested this. I looked through the history and it seems to never have been used. I wonder if we can remove the locking as well.

This is used by the quota and ofd layer which are both server side.

When the server code is merged upstream this can be added to a union that contains only server-side data that overlaps with a union containing only client-side data. For now it is fine to remove from the kernel.

Cheers, Andreas

Signature · 4 lines
Andreas Dilger

Lustre Software Architect
Intel High Performance Data Division