mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: marcin.slusarz@gmail.com
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ben Fennema <bfennema@falcon.csc.calpoly.edu>,
	Jan Kara <jack@suse.cz>,
	Marcin Slusarz <marcin.slusarz@gmail.com>
Subject: [PATCH 07/24] udf: convert UDF_SB_SESSION macro to udf_sb_session function
Date: Sun, 23 Dec 2007 02:50:57 +0100	[thread overview]
Message-ID: <1198374674-12128-8-git-send-email-marcin.slusarz@gmail.com> (raw)
In-Reply-To: <1198374674-12128-1-git-send-email-marcin.slusarz@gmail.com>

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
CC: Ben Fennema <bfennema@falcon.csc.calpoly.edu>
CC: Jan Kara <jack@suse.cz>
---
 fs/udf/misc.c   |    8 ++++----
 fs/udf/super.c  |   28 ++++++++++++++--------------
 fs/udf/udf_sb.h |    6 +++++-
 3 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index 15297de..95baad5 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -197,10 +197,10 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
 	if (block == 0xFFFFFFFF)
 		return NULL;
 
-	bh = udf_tread(sb, block + UDF_SB_SESSION(sb));
+	bh = udf_tread(sb, block + udf_sb_session(sb));
 	if (!bh) {
 		udf_debug("block=%d, location=%d: read failed\n",
-			  block + UDF_SB_SESSION(sb), location);
+			  block + udf_sb_session(sb), location);
 		return NULL;
 	}
 
@@ -210,7 +210,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
 
 	if (location != le32_to_cpu(tag_p->tagLocation)) {
 		udf_debug("location mismatch block %u, tag %u != %u\n",
-			  block + UDF_SB_SESSION(sb), le32_to_cpu(tag_p->tagLocation), location);
+			  block + udf_sb_session(sb), le32_to_cpu(tag_p->tagLocation), location);
 		goto error_out;
 	}
 
@@ -240,7 +240,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block,
 		return bh;
 	}
 	udf_debug("Crc failure block %d: crc = %d, crclen = %d\n",
-		  block + UDF_SB_SESSION(sb), le16_to_cpu(tag_p->descCRC),
+		  block + udf_sb_session(sb), le16_to_cpu(tag_p->descCRC),
 		  le16_to_cpu(tag_p->descCRCLength));
 
 error_out:
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 452e6f6..903c0ec 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -548,7 +548,7 @@ static int udf_vrs(struct super_block *sb, int silent)
 	else
 		sectorsize = sb->s_blocksize;
 
-	sector += (UDF_SB_SESSION(sb) << sb->s_blocksize_bits);
+	sector += (udf_sb_session(sb) << sb->s_blocksize_bits);
 
 	udf_debug("Starting at sector %u (%ld byte sectors)\n",
 		  (sector >> sb->s_blocksize_bits), sb->s_blocksize);
@@ -614,7 +614,7 @@ static int udf_vrs(struct super_block *sb, int silent)
 		return nsr03;
 	else if (nsr02)
 		return nsr02;
-	else if (sector - (UDF_SB_SESSION(sb) << sb->s_blocksize_bits) == 32768)
+	else if (sector - (udf_sb_session(sb) << sb->s_blocksize_bits) == 32768)
 		return -1;
 	else
 		return 0;
@@ -675,15 +675,15 @@ static void udf_find_anchor(struct super_block *sb)
 			}
 
 			if (ident == TAG_IDENT_AVDP) {
-				if (location == last[i] - UDF_SB_SESSION(sb)) {
-					lastblock = last[i] - UDF_SB_SESSION(sb);
+				if (location == last[i] - udf_sb_session(sb)) {
+					lastblock = last[i] - udf_sb_session(sb);
 					UDF_SB_ANCHOR(sb)[0] = lastblock;
 					UDF_SB_ANCHOR(sb)[1] = lastblock - 256;
-				} else if (location == udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb)) {
+				} else if (location == udf_variable_to_fixed(last[i]) - udf_sb_session(sb)) {
 					UDF_SET_FLAG(sb, UDF_FLAG_VARCONV);
-					lastblock = udf_variable_to_fixed(last[i]) - UDF_SB_SESSION(sb);
+					lastblock = udf_variable_to_fixed(last[i]) - udf_sb_session(sb);
 					UDF_SB_ANCHOR(sb)[0] = lastblock;
-					UDF_SB_ANCHOR(sb)[1] = lastblock - 256 - UDF_SB_SESSION(sb);
+					UDF_SB_ANCHOR(sb)[1] = lastblock - 256 - udf_sb_session(sb);
 				} else {
 					udf_debug("Anchor found at block %d, location mismatch %d.\n",
 						  last[i], location);
@@ -704,13 +704,13 @@ static void udf_find_anchor(struct super_block *sb)
 				}
 
 				if (ident == TAG_IDENT_AVDP &&
-				    location == last[i] - 256 - UDF_SB_SESSION(sb)) {
+				    location == last[i] - 256 - udf_sb_session(sb)) {
 					lastblock = last[i];
 					UDF_SB_ANCHOR(sb)[1] = last[i] - 256;
 				} else {
 					ident = location = 0;
-					if (last[i] >= 312 + UDF_SB_SESSION(sb)) {
-						bh = sb_bread(sb, last[i] - 312 - UDF_SB_SESSION(sb));
+					if (last[i] >= 312 + udf_sb_session(sb)) {
+						bh = sb_bread(sb, last[i] - 312 - udf_sb_session(sb));
 						if (bh) {
 							tag *t = (tag *)bh->b_data;
 							ident = le16_to_cpu(t->tagIdent);
@@ -732,7 +732,7 @@ static void udf_find_anchor(struct super_block *sb)
 
 	if (!lastblock) {
 		/* We haven't found the lastblock. check 312 */
-		bh = sb_bread(sb, 312 + UDF_SB_SESSION(sb));
+		bh = sb_bread(sb, 312 + udf_sb_session(sb));
 		if (bh) {
 			tag *t = (tag *)bh->b_data;
 			ident = le16_to_cpu(t->tagIdent);
@@ -1506,11 +1506,11 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
 		goto error_out;
 
 	if (uopt.session == 0xFFFFFFFF)
-		UDF_SB_SESSION(sb) = udf_get_last_session(sb);
+		udf_sb(sb)->s_session = udf_get_last_session(sb);
 	else
-		UDF_SB_SESSION(sb) = uopt.session;
+		udf_sb(sb)->s_session = uopt.session;
 
-	udf_debug("Multi-session=%d\n", UDF_SB_SESSION(sb));
+	udf_debug("Multi-session=%d\n", udf_sb_session(sb));
 
 	UDF_SB_LASTBLOCK(sb) = uopt.lastblock;
 	UDF_SB_ANCHOR(sb)[0] = UDF_SB_ANCHOR(sb)[1] = 0;
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 6eb9ef4..f33d38e 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -70,6 +70,11 @@ static inline __u16 udf_sb_partition(struct super_block *sb)
 	return udf_sb(sb)->s_partition;
 }
 
+static inline __s32 udf_sb_session(struct super_block *sb)
+{
+	return udf_sb(sb)->s_session;
+}
+
 #define UDF_SB_ALLOC_PARTMAPS(X,Y)\
 {\
 	udf_sb(X)->s_partmaps = kmalloc(sizeof(struct udf_part_map) * Y, GFP_KERNEL);\
@@ -134,7 +139,6 @@ static inline __u16 udf_sb_partition(struct super_block *sb)
 #define UDF_SB_BITMAP(X,Y,Z,I)			( udf_sb_partmaps(X)[(Y)].Z.s_bitmap->s_block_bitmap[I] )
 #define UDF_SB_BITMAP_NR_GROUPS(X,Y,Z)		( udf_sb_partmaps(X)[(Y)].Z.s_bitmap->s_nr_groups )
 
-#define UDF_SB_SESSION(X)			( udf_sb(X)->s_session )
 #define UDF_SB_ANCHOR(X)			( udf_sb(X)->s_anchor )
 #define UDF_SB_LASTBLOCK(X)			( udf_sb(X)->s_lastblock )
 #define UDF_SB_LVIDBH(X)			( udf_sb(X)->s_lvidbh )
-- 
1.5.3.4


  parent reply	other threads:[~2007-12-23  1:52 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-23  1:50 [PATCH 00/24] udf: convert super_block macros to functions marcin.slusarz
2007-12-23  1:50 ` [PATCH 01/24] udf: fix coding style of super.c marcin.slusarz
2008-01-07 11:13   ` Jan Kara
2007-12-23  1:50 ` [PATCH 02/24] udf: rename UDF_SB to udf_sb marcin.slusarz
2007-12-23 12:04   ` Christoph Hellwig
2007-12-23  1:50 ` [PATCH 03/24] udf: convert some macros to inline functions marcin.slusarz
2007-12-23  1:50 ` [PATCH 04/24] udf: convert UDF_SB_VOLIDENT macro to udf_sb_volume_ident function marcin.slusarz
2007-12-23 12:08   ` Christoph Hellwig
2007-12-23  1:50 ` [PATCH 05/24] udf: convert UDF_SB_NUMPARTS macro to udf_sb_num_parts function marcin.slusarz
2007-12-23 12:09   ` Christoph Hellwig
2007-12-23  1:50 ` [PATCH 06/24] udf: convert UDF_SB_PARTITION macro to udf_sb_partition function marcin.slusarz
2007-12-23  1:50 ` marcin.slusarz [this message]
2007-12-23  1:50 ` [PATCH 08/24] udf: convert UDF_SB_ANCHOR macro to udf_sb_anchor function marcin.slusarz
2007-12-23  1:50 ` [PATCH 09/24] udf: convert UDF_SB_LASTBLOCK macro to udf_sb_last_block function marcin.slusarz
2007-12-23  1:51 ` [PATCH 10/24] udf: convert UDF_SB_LVIDBH macro to udf_sb_lvid_bh function marcin.slusarz
2007-12-23  1:51 ` [PATCH 11/24] udf: convert UDF_SB_LVID macro to udf_sb_lvid function marcin.slusarz
2007-12-23  1:51 ` [PATCH 12/24] udf: convert UDF_SB_LVIDIU macro to udf_sb_lvidiu function marcin.slusarz
2007-12-23  1:51 ` [PATCH 13/24] udf: remove unused macros marcin.slusarz
2007-12-23  1:51 ` [PATCH 14/24] udf: convert UDF_SB_RECORDTIME macro to udf_sb_record_time function marcin.slusarz
2007-12-23  1:51 ` [PATCH 15/24] udf: convert UDF_SB_SERIALNUM macro to udf_sb_serial_number function marcin.slusarz
2007-12-23  1:51 ` [PATCH 16/24] udf: convert UDF_SB_UDFREV macro to udf_sb_revision function marcin.slusarz
2007-12-23  1:51 ` [PATCH 17/24] udf: convert UDF_SB_VAT macro to udf_sb_vat_inode function marcin.slusarz
2007-12-23  1:51 ` [PATCH 18/24] udf: convert UDF_SB_ALLOC_PARTMAPS macro to udf_sb_alloc_partition_maps function marcin.slusarz
2007-12-23  1:51 ` [PATCH 19/24] udf: check if udf_load_logicalvol failed marcin.slusarz
2008-01-07 11:29   ` Jan Kara
2008-01-07 19:19     ` Marcin Slusarz
2007-12-23  1:51 ` [PATCH 20/24] udf: convert UDF_UPDATE_UDFREV macro to udf_update_revision function marcin.slusarz
2007-12-23  1:51 ` [PATCH 21/24] udf: remove some UDF_SB_* macros marcin.slusarz
2008-01-07 11:34   ` Jan Kara
2007-12-23  1:51 ` [PATCH 22/24] udf: convert UDF_SB_ALLOC_BITMAP macro to udf_sb_alloc_bitmap function marcin.slusarz
2008-01-07 11:35   ` Jan Kara
2007-12-23  1:51 ` [PATCH 23/24] udf: convert UDF_SB_FREE_BITMAP macro to udf_sb_free_bitmap function marcin.slusarz
2008-01-07 11:36   ` Jan Kara
2007-12-23  1:51 ` [PATCH 24/24] udf: fix sparse warnings (shadowing & mismatch between declaration and definition) marcin.slusarz
2008-01-07 11:37   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1198374674-12128-8-git-send-email-marcin.slusarz@gmail.com \
    --to=marcin.slusarz@gmail.com \
    --cc=bfennema@falcon.csc.calpoly.edu \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®