lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] isofs: alignment fix for uni16_to_x8()
With some CDs on alpha I have a LOT of unaligned traps
while reading directories. Here is a fix.

Ivan.

--- 2.4.0t7/fs/isofs/joliet.c Tue Aug 1 18:55:42 2000
+++ linux/fs/isofs/joliet.c Fri Aug 25 18:42:45 2000
@@ -10,6 +10,7 @@
#include <linux/nls.h>
#include <linux/malloc.h>
#include <linux/iso_fs.h>
+#include <asm/unaligned.h>

/*
* Convert Unicode 16 to UTF8 or ASCII.
@@ -17,15 +18,15 @@
static int
uni16_to_x8(unsigned char *ascii, u16 *uni, int len, struct nls_table *nls)
{
- wchar_t *ip;
+ wchar_t *ip, ch;
unsigned char *op;

ip = uni;
op = ascii;

- while (*ip && len) {
+ while ((ch = get_unaligned(ip)) && len) {
int llen;
- wchar_t ch = be16_to_cpu(*ip);
+ ch = be16_to_cpu(ch);
if ((llen = nls->uni2char(ch, op, NLS_MAX_CHARSET_SIZE)) > 0)
op += llen;
else
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.023 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site