Staging: lustre: Replace non-standard spinlock macro definations

Author: Vaishali Thakkar <vthakkar1994@gmail.com>

This patch replaces non-standard spin lock macro with standard linux function.

This is done using Coccinelle and semantic patch used is as follows:

@@
expression x;
@@

- TREE_READ_LOCK_IRQ(x)
+ spin_lock_irq(&(x)->tree_lock)

@@
expression x;
@@

- TREE_READ_UNLOCK_IRQ(x)
+ spin_unlock_irq(&(x)->tree_lock)

Also semantic patch result is modified by droping ->,
inner & and adding . for simplification of code.

Signed-off-by: Vaishali Thakkar 
Acked-by: Julia Lawall 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index a8bcc51..d614752 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1880,8 +1880,8 @@ void ll_delete_inode(struct inode *inode)
 
 	/* Workaround for LU-118 */
 	if (inode->i_data.nrpages) {
-		TREE_READ_LOCK_IRQ(&inode->i_data);
-		TREE_READ_UNLOCK_IRQ(&inode->i_data);
+		spin_lock_irq(&inode->i_data.tree_lock);
+		spin_unlock_irq(&inode->i_data.tree_lock);
 		LASSERTF(inode->i_data.nrpages == 0,
 			 "inode=%lu/%u(%p) nrpages=%lu, see "
 			 "http://jira.whamcloud.com/browse/LU-118\n",
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.