[PATCH 6/9] isofs: convert macro to function in rock.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch converts the CHECK_SP macro to a proper function in
fs/isofs/rock.c. 

Signed-off-by: Pekka Enberg <[email protected]>
---

 rock.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

Index: 2.6/fs/isofs/rock.c
===================================================================
--- 2.6.orig/fs/isofs/rock.c	2005-03-28 16:32:13.000000000 +0300
+++ 2.6/fs/isofs/rock.c	2005-03-28 16:32:16.000000000 +0300
@@ -28,15 +28,13 @@
 
 #define SIG(A,B) ((A) | ((B) << 8))	/* isonum_721() */
 
-/* This is a way of ensuring that we have something in the system
-   use fields that is compatible with Rock Ridge */
-#define CHECK_SP(FAIL)	       			\
-      if(rr->u.SP.magic[0] != 0xbe) FAIL;	\
-      if(rr->u.SP.magic[1] != 0xef) FAIL;       \
-      ISOFS_SB(inode->i_sb)->s_rock_offset=rr->u.SP.skip;
-/* We define a series of macros because each function must do exactly the
-   same thing in certain places.  We use the macros to ensure that everything
-   is done correctly */
+static inline int rock_set_offset(struct inode *inode, struct rock_ridge * rr)
+{
+      if (rr->u.SP.magic[0] != 0xbe || rr->u.SP.magic[1] != 0xef)
+	      return 0;
+      ISOFS_SB(inode->i_sb)->s_rock_offset = rr->u.SP.skip;
+      return 1;
+}
 
 static int setup_rock_ridge(struct iso_directory_record *de, struct inode *inode, unsigned char ** chr)
 {
@@ -92,7 +90,8 @@
 					goto out;
 				break;
 			case SIG('S', 'P'):
-				CHECK_SP(goto out);
+				if (!rock_set_offset(inode, rr))
+					goto out;
 				break;
 			case SIG('C', 'E'):
 				{
@@ -225,7 +224,8 @@
 				break;
 #endif
 			case SIG('S', 'P'):
-				CHECK_SP(goto out);
+				if (!rock_set_offset(inode, rr))
+					goto out;
 				break;
 			case SIG('C', 'E'):
 				{
@@ -612,7 +612,8 @@
 				goto out;
 			break;
 		case SIG('S', 'P'):
-			CHECK_SP(goto out);
+			if (!rock_set_offset(inode, rr))
+				goto out;
 			break;
 		case SIG('S', 'L'):
 			rpnt = get_symlink_chunk(rpnt, rr,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux