From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Phillip Lougher <phillip@lougher.demon.co.uk>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 8/10] squashfs: add swabbing infrastructure
Date: Fri, 22 Apr 2005 09:23:56 +0200 [thread overview]
Message-ID: <20050422072355.GE10459@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20050422072251.GD10459@wohnheim.fh-wedel.de>
Jörn
--
Correctness comes second.
Features come third.
Performance comes last.
Maintainability is needed for all of them.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
---
fs/squashfs/inode.c | 16 ++++++++++++++++
include/linux/squashfs_fs_sb.h | 3 +++
2 files changed, 19 insertions(+)
--- linux-2.6.12-rc3cow/fs/squashfs/inode.c~squashfs_cu8 2005-04-22 08:09:25.993528336 +0200
+++ linux-2.6.12-rc3cow/fs/squashfs/inode.c 2005-04-22 09:17:42.136819904 +0200
@@ -43,6 +43,16 @@
#include <linux/vmalloc.h>
#include "squashfs.h"
+
+#define SQUASHFS_SWAB(XX) \
+u##XX squashfs_swab##XX(u##XX x) { return swab##XX(x); } \
+u##XX squashfs_ident##XX(u##XX x) { return x; }
+
+SQUASHFS_SWAB(16)
+SQUASHFS_SWAB(32)
+SQUASHFS_SWAB(64)
+
+
static void squashfs_put_super(struct super_block *);
static int squashfs_statfs(struct super_block *, struct kstatfs *);
static int squashfs_symlink_readpage(struct file *file, struct page *page);
@@ -862,6 +872,9 @@ static int squashfs_fill_super(struct su
/* Check it is a SQUASHFS superblock */
msBlk->swap = 0;
+ msBlk->swab16 = squashfs_ident16;
+ msBlk->swab32 = squashfs_ident32;
+ msBlk->swab64 = squashfs_ident64;
if ((s->s_magic = sBlk->s_magic) != SQUASHFS_MAGIC) {
if (sBlk->s_magic == SQUASHFS_MAGIC_SWAP) {
squashfs_super_block sblk;
@@ -872,6 +885,9 @@ static int squashfs_fill_super(struct su
SQUASHFS_SWAP_SUPER_BLOCK(&sblk, sBlk);
memcpy(sBlk, &sblk, sizeof(squashfs_super_block));
msBlk->swap = 1;
+ msBlk->swab16 = squashfs_swab16;
+ msBlk->swab32 = squashfs_swab32;
+ msBlk->swab64 = squashfs_swab64;
} else {
SERROR("Can't find a SQUASHFS superblock on %s\n",
bdevname(s->s_bdev, b));
--- linux-2.6.12-rc3cow/include/linux/squashfs_fs_sb.h~squashfs_cu8 2005-04-22 07:13:33.526180840 +0200
+++ linux-2.6.12-rc3cow/include/linux/squashfs_fs_sb.h 2005-04-22 08:54:52.891976760 +0200
@@ -44,6 +44,9 @@ typedef struct squashfs_sb_info {
int devblksize;
int devblksize_log2;
int swap;
+ u16 (*swab16)(u16);
+ u32 (*swab32)(u32);
+ u64 (*swab64)(u64);
squashfs_cache *block_cache;
struct squashfs_fragment_cache *fragment;
int next_cache;
next prev parent reply other threads:[~2005-04-22 7:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-20 6:55 [PATCH] remove some usesless casts Jörn Engel
2005-04-20 15:20 ` Phillip Lougher
2005-04-20 21:33 ` Jörn Engel
2005-04-20 20:51 ` Phillip Lougher
2005-04-21 1:06 ` Jörn Engel
2005-04-21 6:36 ` Pekka Enberg
2005-04-21 6:48 ` Jörn Engel
2005-04-21 1:08 ` [PATCH 2/4] squashfs: kmalloc (less stack, less casts) Jörn Engel
2005-04-21 1:10 ` [PATCH 3/4] squashfs: (void*)ify squashfs_get_cached_block Jörn Engel
2005-04-21 1:11 ` [PATCH 4/4] squashfs: (void*)ify squashfs_read_data Jörn Engel
2005-04-22 7:20 ` [PATCH 5/10] squashfs: (void*)ify read_blocklist Jörn Engel
2005-04-22 7:22 ` [PATCH 6/10] squashfs: conserve stack, remove casts Jörn Engel
2005-04-22 7:22 ` [PATCH 6/10] squashfs: remove one cast Jörn Engel
2005-04-22 7:23 ` Jörn Engel [this message]
2005-04-22 7:24 ` [PATCH 9/10] squashfs: remove some more casts Jörn Engel
2005-04-22 7:25 ` [PATCH 9/10] squashfs: first use of swabbing Jörn Engel
2005-04-22 7:52 ` [PATCH 8/10] squashfs: add swabbing infrastructure Jörn Engel
2005-04-22 7:26 ` [PATCH 6/10] squashfs: remove one cast Jörn Engel
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=20050422072355.GE10459@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
--cc=phillip@lougher.demon.co.uk \
/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®