a couple cleanups for jfs
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJU3NR8AAoJEDaohF61QIxkKsMP/Rv/2+WasvgZDH8I/c0YoWmJ XHdMaUGOtFCQP5TezJPUrbqpXnEJrTU9RBMre7J7Z7FPMBqg4mPS++yPwYnkY1zx LjO57Mj1y4eEPBNcfCcBpY+RlMlr8+Ts6SRxqDRlHjzIpXNnEHej03LcbvJg31gp ukFVJwWH9jsvxloBwcrgEgEbzBS3cFhCPliGJa5VhvFHK8DcIpHNzA1mwhYzr8NX 5aO/Enbt8TFdoV3Oai9PiLqFJpF2C8NqhxfHOk6M3sosN0QGMb62NZMUySsKpCl6 Q+0QZOgKVEQkzdwob6kA2iMa5ufrsDpu2xe9w7vSgPieWThQFqWsSfX5/9h5hJyL Y1qS9NhYPPxHOtSORdBIW9txwg+mYg6dL+xy8oPeNzAMi0f4PYY+7zASMY+f59YA aICuCobCIL2gb0pJf6/83oSb6wbIvPeN3kdAIMBUYNcRaGvI36fhFJaRF4FPs0i4 DwVhu/GDlL7/sSAqQUWnDKzR3lrHBu3YrwcwQMjA0zWhsYhtH+NUnAqm+nZS0mLI aYtoZhry6ykfObRMfFQcOAsAUcVYKOpMnX2nt9aAG66xXhab9Fo4cDlEZjHxM5Lr 0rHOiWOmLZkbfKQ9ZVpNjSV2skIzAeGA/RG5RPR1JWDAnkcqr67/MdC0YbkIyNaG pmCIOjq/3ivGAhJdTXgp =QbrB -----END PGP SIGNATURE----- Merge tag 'jfs-3.20' of git://github.com/kleikamp/linux-shaggy Pull jfs updates from David Kleikamp: "A couple cleanups for jfs" * tag 'jfs-3.20' of git://github.com/kleikamp/linux-shaggy: jfs: Deletion of an unnecessary check before the function call "unload_nls" jfs: get rid of homegrown endianness helpers
This commit is contained in:
commit
87c9172f71
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) International Business Machines Corp., 2001
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||
* the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#ifndef _H_ENDIAN24
|
||||
#define _H_ENDIAN24
|
||||
|
||||
/*
|
||||
* endian24.h:
|
||||
*
|
||||
* Endian conversion for 24-byte data
|
||||
*
|
||||
*/
|
||||
#define __swab24(x) \
|
||||
({ \
|
||||
__u32 __x = (x); \
|
||||
((__u32)( \
|
||||
((__x & (__u32)0x000000ffUL) << 16) | \
|
||||
(__x & (__u32)0x0000ff00UL) | \
|
||||
((__x & (__u32)0x00ff0000UL) >> 16) )); \
|
||||
})
|
||||
|
||||
#if (defined(__KERNEL__) && defined(__LITTLE_ENDIAN)) || (defined(__BYTE_ORDER) && (__BYTE_ORDER == __LITTLE_ENDIAN))
|
||||
#define __cpu_to_le24(x) ((__u32)(x))
|
||||
#define __le24_to_cpu(x) ((__u32)(x))
|
||||
#else
|
||||
#define __cpu_to_le24(x) __swab24(x)
|
||||
#define __le24_to_cpu(x) __swab24(x)
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define cpu_to_le24 __cpu_to_le24
|
||||
#define le24_to_cpu __le24_to_cpu
|
||||
#endif
|
||||
|
||||
#endif /* !_H_ENDIAN24 */
|
|
@ -1040,8 +1040,8 @@ static int dtSplitUp(tid_t tid,
|
|||
pxdlist.maxnpxd = 1;
|
||||
pxdlist.npxd = 0;
|
||||
pxd = &pxdlist.pxd[0];
|
||||
PXDaddress(pxd, nxaddr)
|
||||
PXDlength(pxd, xlen + n);
|
||||
PXDaddress(pxd, nxaddr);
|
||||
PXDlength(pxd, xlen + n);
|
||||
split->pxdlist = &pxdlist;
|
||||
if ((rc = dtExtendPage(tid, ip, split, btstack))) {
|
||||
nxaddr = addressPXD(pxd);
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/nls.h>
|
||||
|
||||
#include "endian24.h"
|
||||
|
||||
/*
|
||||
* transaction and lock id's
|
||||
*
|
||||
|
@ -59,26 +57,42 @@ struct timestruc_t {
|
|||
|
||||
/*
|
||||
* physical xd (pxd)
|
||||
*
|
||||
* The leftmost 24 bits of len_addr are the extent length.
|
||||
* The rightmost 8 bits of len_addr are the most signficant bits of
|
||||
* the extent address
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned len:24;
|
||||
unsigned addr1:8;
|
||||
__le32 len_addr;
|
||||
__le32 addr2;
|
||||
} pxd_t;
|
||||
|
||||
/* xd_t field construction */
|
||||
|
||||
#define PXDlength(pxd, length32) ((pxd)->len = __cpu_to_le24(length32))
|
||||
#define PXDaddress(pxd, address64)\
|
||||
{\
|
||||
(pxd)->addr1 = ((s64)address64) >> 32;\
|
||||
(pxd)->addr2 = __cpu_to_le32((address64) & 0xffffffff);\
|
||||
static inline void PXDlength(pxd_t *pxd, __u32 len)
|
||||
{
|
||||
pxd->len_addr = (pxd->len_addr & cpu_to_le32(~0xffffff)) |
|
||||
cpu_to_le32(len & 0xffffff);
|
||||
}
|
||||
|
||||
static inline void PXDaddress(pxd_t *pxd, __u64 addr)
|
||||
{
|
||||
pxd->len_addr = (pxd->len_addr & cpu_to_le32(0xffffff)) |
|
||||
cpu_to_le32((addr >> 32)<<24);
|
||||
pxd->addr2 = cpu_to_le32(addr & 0xffffffff);
|
||||
}
|
||||
|
||||
/* xd_t field extraction */
|
||||
#define lengthPXD(pxd) __le24_to_cpu((pxd)->len)
|
||||
#define addressPXD(pxd)\
|
||||
( ((s64)((pxd)->addr1)) << 32 | __le32_to_cpu((pxd)->addr2))
|
||||
static inline __u32 lengthPXD(pxd_t *pxd)
|
||||
{
|
||||
return le32_to_cpu((pxd)->len_addr) & 0xffffff;
|
||||
}
|
||||
|
||||
static inline __u64 addressPXD(pxd_t *pxd)
|
||||
{
|
||||
__u64 n = le32_to_cpu(pxd->len_addr) & ~0xffffff;
|
||||
return (n << 8) + le32_to_cpu(pxd->addr2);
|
||||
}
|
||||
|
||||
#define MAXTREEHEIGHT 8
|
||||
/* pxd list */
|
||||
|
@ -93,12 +107,10 @@ struct pxdlist {
|
|||
* data extent descriptor (dxd)
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned flag:8; /* 1: flags */
|
||||
unsigned rsrvd:24;
|
||||
__u8 flag; /* 1: flags */
|
||||
__u8 rsrvd[3];
|
||||
__le32 size; /* 4: size in byte */
|
||||
unsigned len:24; /* 3: length in unit of fsblksize */
|
||||
unsigned addr1:8; /* 1: address in unit of fsblksize */
|
||||
__le32 addr2; /* 4: address in unit of fsblksize */
|
||||
pxd_t loc; /* 8: address and length in unit of fsblksize */
|
||||
} dxd_t; /* - 16 - */
|
||||
|
||||
/* dxd_t flags */
|
||||
|
@ -109,12 +121,11 @@ typedef struct {
|
|||
#define DXD_CORRUPT 0x08 /* Inconsistency detected */
|
||||
|
||||
/* dxd_t field construction
|
||||
* Conveniently, the PXD macros work for DXD
|
||||
*/
|
||||
#define DXDlength PXDlength
|
||||
#define DXDaddress PXDaddress
|
||||
#define lengthDXD lengthPXD
|
||||
#define addressDXD addressPXD
|
||||
#define DXDlength(dxd, len) PXDlength(&(dxd)->loc, len)
|
||||
#define DXDaddress(dxd, addr) PXDaddress(&(dxd)->loc, addr)
|
||||
#define lengthDXD(dxd) lengthPXD(&(dxd)->loc)
|
||||
#define addressDXD(dxd) addressPXD(&(dxd)->loc)
|
||||
#define DXDsize(dxd, size32) ((dxd)->size = cpu_to_le32(size32))
|
||||
#define sizeDXD(dxd) le32_to_cpu((dxd)->size)
|
||||
|
||||
|
|
|
@ -29,13 +29,11 @@
|
|||
* extent allocation descriptor (xad)
|
||||
*/
|
||||
typedef struct xad {
|
||||
unsigned flag:8; /* 1: flag */
|
||||
unsigned rsvrd:16; /* 2: reserved */
|
||||
unsigned off1:8; /* 1: offset in unit of fsblksize */
|
||||
__le32 off2; /* 4: offset in unit of fsblksize */
|
||||
unsigned len:24; /* 3: length in unit of fsblksize */
|
||||
unsigned addr1:8; /* 1: address in unit of fsblksize */
|
||||
__le32 addr2; /* 4: address in unit of fsblksize */
|
||||
__u8 flag; /* 1: flag */
|
||||
__u8 rsvrd[2]; /* 2: reserved */
|
||||
__u8 off1; /* 1: offset in unit of fsblksize */
|
||||
__le32 off2; /* 4: offset in unit of fsblksize */
|
||||
pxd_t loc; /* 8: length and address in unit of fsblksize */
|
||||
} xad_t; /* (16) */
|
||||
|
||||
#define MAXXLEN ((1 << 24) - 1)
|
||||
|
@ -49,19 +47,14 @@ typedef struct xad {
|
|||
(xad)->off1 = ((u64)offset64) >> 32;\
|
||||
(xad)->off2 = __cpu_to_le32((offset64) & 0xffffffff);\
|
||||
}
|
||||
#define XADaddress(xad, address64)\
|
||||
{\
|
||||
(xad)->addr1 = ((u64)address64) >> 32;\
|
||||
(xad)->addr2 = __cpu_to_le32((address64) & 0xffffffff);\
|
||||
}
|
||||
#define XADlength(xad, length32) (xad)->len = __cpu_to_le24(length32)
|
||||
#define XADaddress(xad, address64) PXDaddress(&(xad)->loc, address64)
|
||||
#define XADlength(xad, length32) PXDlength(&(xad)->loc, length32)
|
||||
|
||||
/* xad_t field extraction */
|
||||
#define offsetXAD(xad)\
|
||||
( ((s64)((xad)->off1)) << 32 | __le32_to_cpu((xad)->off2))
|
||||
#define addressXAD(xad)\
|
||||
( ((s64)((xad)->addr1)) << 32 | __le32_to_cpu((xad)->addr2))
|
||||
#define lengthXAD(xad) __le24_to_cpu((xad)->len)
|
||||
#define addressXAD(xad) addressPXD(&(xad)->loc)
|
||||
#define lengthXAD(xad) lengthPXD(&(xad)->loc)
|
||||
|
||||
/* xad list */
|
||||
struct xadlist {
|
||||
|
|
|
@ -619,8 +619,7 @@ out_mount_failed:
|
|||
iput(sbi->direct_inode);
|
||||
sbi->direct_inode = NULL;
|
||||
out_unload:
|
||||
if (sbi->nls_tab)
|
||||
unload_nls(sbi->nls_tab);
|
||||
unload_nls(sbi->nls_tab);
|
||||
out_kfree:
|
||||
kfree(sbi);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue