From: Jan Kara <jack@suse.cz>
To: linux-fsdevel@vger.kernel.org
Cc: Jan Kara <jack@suse.cz>
Subject: [PATCH 2/3] udf: Make s_block_bitmap standard array
Date: Tue, 5 Feb 2013 15:40:22 +0100 [thread overview]
Message-ID: <1360075223-9972-3-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1360075223-9972-1-git-send-email-jack@suse.cz>
struct udf_bitmap has array of buffer pointers attached to it. The code
unnecessarily used s_block_bitmap as a pointer to the array instead of
the standard trick of using 0 length array in the declaration. Change
that to make code more readable and actually shrink the structure by one
pointer.
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/udf/super.c | 1 -
fs/udf/udf_sb.h | 2 +-
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index da8ce9f..f883080 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1023,7 +1023,6 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
if (bitmap == NULL)
return NULL;
- bitmap->s_block_bitmap = (struct buffer_head **)(bitmap + 1);
bitmap->s_nr_groups = nr_groups;
return bitmap;
}
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 8d1c9d4..4f7ddb7 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -83,7 +83,7 @@ struct udf_bitmap {
__u32 s_extLength;
__u32 s_extPosition;
int s_nr_groups;
- struct buffer_head **s_block_bitmap;
+ struct buffer_head *s_block_bitmap[0];
};
struct udf_part_map {
--
1.7.1
next prev parent reply other threads:[~2013-02-05 14:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-05 14:40 [PATCH 0/3] UDF overflow fix and cleanups Jan Kara
2013-02-05 14:40 ` [PATCH 1/3] udf: Fix bitmap overflow on large filesystems with small block size Jan Kara
2013-02-05 14:40 ` Jan Kara [this message]
2013-02-05 14:40 ` [PATCH 3/3] udf: Remove unused s_extLength from udf_bitmap 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=1360075223-9972-3-git-send-email-jack@suse.cz \
--to=jack@suse.cz \
--cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).