Commit 6acd292f authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-dj.bkbits.net/cpufreq

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents b982274d 9b3747c7
...@@ -252,7 +252,8 @@ void __init check_ioapic(void) ...@@ -252,7 +252,8 @@ void __init check_ioapic(void)
switch (vendor) { switch (vendor) {
case PCI_VENDOR_ID_VIA: case PCI_VENDOR_ID_VIA:
#ifdef CONFIG_GART_IOMMU #ifdef CONFIG_GART_IOMMU
if (end_pfn >= (0xffffffff>>PAGE_SHIFT) && if ((end_pfn >= (0xffffffff>>PAGE_SHIFT) ||
force_iommu) &&
!iommu_aperture_allowed) { !iommu_aperture_allowed) {
printk(KERN_INFO printk(KERN_INFO
"Looks like a VIA chipset. Disabling IOMMU. Overwrite with \"iommu=allowed\"\n"); "Looks like a VIA chipset. Disabling IOMMU. Overwrite with \"iommu=allowed\"\n");
......
...@@ -517,7 +517,7 @@ static void ohci_initialize(struct ti_ohci *ohci) ...@@ -517,7 +517,7 @@ static void ohci_initialize(struct ti_ohci *ohci)
1<<(((reg_read(ohci, OHCI1394_BusOptions)>>12)&0xf)+1); 1<<(((reg_read(ohci, OHCI1394_BusOptions)>>12)&0xf)+1);
if (ohci->max_packet_size < 512) { if (ohci->max_packet_size < 512) {
HPSB_WARNING("warning: Invalid max packet size of %d, setting to 512", HPSB_ERR("warning: Invalid max packet size of %d, setting to 512",
ohci->max_packet_size); ohci->max_packet_size);
ohci->max_packet_size = 512; ohci->max_packet_size = 512;
} }
......
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
#define DRV_MODULE_NAME "tg3" #define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.5" #define DRV_MODULE_VERSION "3.6"
#define DRV_MODULE_RELDATE "May 25, 2004" #define DRV_MODULE_RELDATE "June 12, 2004"
#define TG3_DEF_MAC_MODE 0 #define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0 #define TG3_DEF_RX_MODE 0
...@@ -177,6 +177,8 @@ static struct pci_device_id tg3_pci_tbl[] = { ...@@ -177,6 +177,8 @@ static struct pci_device_id tg3_pci_tbl[] = {
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5788, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5788,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5789,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901_2, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901_2,
...@@ -195,6 +197,10 @@ static struct pci_device_id tg3_pci_tbl[] = { ...@@ -195,6 +197,10 @@ static struct pci_device_id tg3_pci_tbl[] = {
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750M, { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750M,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751M,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751F,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX, { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
{ PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX, { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX,
...@@ -7536,6 +7542,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -7536,6 +7542,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
udelay(50); udelay(50);
tg3_nvram_init(tp); tg3_nvram_init(tp);
/* Always use host TXDs, it performs better in particular
* with multi-frag packets. The tests below are kept here
* as documentation should we change this decision again
* in the future.
*/
tp->tg3_flags |= TG3_FLAG_HOST_TXDS;
#if 0
/* Determine if TX descriptors will reside in /* Determine if TX descriptors will reside in
* main memory or in the chip SRAM. * main memory or in the chip SRAM.
*/ */
...@@ -7543,6 +7557,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -7543,6 +7557,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
tp->tg3_flags |= TG3_FLAG_HOST_TXDS; tp->tg3_flags |= TG3_FLAG_HOST_TXDS;
#endif
grc_misc_cfg = tr32(GRC_MISC_CFG); grc_misc_cfg = tr32(GRC_MISC_CFG);
grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK; grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK;
...@@ -7565,7 +7580,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -7565,7 +7580,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM && tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM &&
(tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901 || (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901 ||
tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901_2 || tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901_2 ||
tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F))) tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F)) ||
(tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM &&
tp->pdev->device == PCI_DEVICE_ID_TIGON3_5751F))
tp->tg3_flags |= TG3_FLAG_10_100_ONLY; tp->tg3_flags |= TG3_FLAG_10_100_ONLY;
err = tg3_phy_probe(tp); err = tg3_phy_probe(tp);
...@@ -8446,6 +8463,8 @@ static int tg3_resume(struct pci_dev *pdev) ...@@ -8446,6 +8463,8 @@ static int tg3_resume(struct pci_dev *pdev)
if (!netif_running(dev)) if (!netif_running(dev))
return 0; return 0;
pci_restore_state(tp->pdev, tp->pci_cfg_state);
err = tg3_set_power_state(tp, 0); err = tg3_set_power_state(tp, 0);
if (err) if (err)
return err; return err;
......
...@@ -6248,10 +6248,13 @@ ...@@ -6248,10 +6248,13 @@
1676 NetXtreme BCM5750 Gigabit Ethernet 1676 NetXtreme BCM5750 Gigabit Ethernet
1677 NetXtreme BCM5751 Gigabit Ethernet 1677 NetXtreme BCM5751 Gigabit Ethernet
167c NetXtreme BCM5750M Gigabit Ethernet 167c NetXtreme BCM5750M Gigabit Ethernet
167d NetXtreme BCM5751M Gigabit Ethernet
167e NetXtreme BCM5751F Gigabit Ethernet
1696 NetXtreme BCM5782 Gigabit Ethernet 1696 NetXtreme BCM5782 Gigabit Ethernet
103c 12bc HP d530 CMT (DG746A) 103c 12bc HP d530 CMT (DG746A)
14e4 000d NetXtreme BCM5782 1000Base-T 14e4 000d NetXtreme BCM5782 1000Base-T
169c NetXtreme BCM5788 Gigabit Ethernet 169c NetXtreme BCM5788 Gigabit Ethernet
169d NetXtreme BCM5789 Gigabit Ethernet
16a6 NetXtreme BCM5702X Gigabit Ethernet 16a6 NetXtreme BCM5702X Gigabit Ethernet
0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
1028 0126 BCM5702 1000Base-T 1028 0126 BCM5702 1000Base-T
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2001 * Copyright (C) International Business Machines Corp., 2000-2004
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -108,13 +108,12 @@ struct btpage { ...@@ -108,13 +108,12 @@ struct btpage {
* record the path traversed during the search; * record the path traversed during the search;
* top frame record the leaf page/entry selected. * top frame record the leaf page/entry selected.
*/ */
#define MAXTREEHEIGHT 8
struct btframe { /* stack frame */ struct btframe { /* stack frame */
s64 bn; /* 8: */ s64 bn; /* 8: */
s16 index; /* 2: */ s16 index; /* 2: */
s16 lastindex; /* 2: */ s16 lastindex; /* 2: unused */
struct metapage *mp; /* 4: */ struct metapage *mp; /* 4/8: */
}; /* (16) */ }; /* (16/24) */
struct btstack { struct btstack {
struct btframe *top; struct btframe *top;
...@@ -125,12 +124,15 @@ struct btstack { ...@@ -125,12 +124,15 @@ struct btstack {
#define BT_CLR(btstack)\ #define BT_CLR(btstack)\
(btstack)->top = (btstack)->stack (btstack)->top = (btstack)->stack
#define BT_STACK_FULL(btstack)\
( (btstack)->top == &((btstack)->stack[MAXTREEHEIGHT-1]))
#define BT_PUSH(BTSTACK, BN, INDEX)\ #define BT_PUSH(BTSTACK, BN, INDEX)\
{\ {\
assert(!BT_STACK_FULL(BTSTACK));\
(BTSTACK)->top->bn = BN;\ (BTSTACK)->top->bn = BN;\
(BTSTACK)->top->index = INDEX;\ (BTSTACK)->top->index = INDEX;\
++(BTSTACK)->top;\ ++(BTSTACK)->top;\
assert((BTSTACK)->top != &((BTSTACK)->stack[MAXTREEHEIGHT]));\
} }
#define BT_POP(btstack)\ #define BT_POP(btstack)\
...@@ -139,6 +141,16 @@ struct btstack { ...@@ -139,6 +141,16 @@ struct btstack {
#define BT_STACK(btstack)\ #define BT_STACK(btstack)\
( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top ) ( (btstack)->top == (btstack)->stack ? NULL : (btstack)->top )
static inline void BT_STACK_DUMP(struct btstack *btstack)
{
int i;
printk("btstack dump:\n");
for (i = 0; i < MAXTREEHEIGHT; i++)
printk(KERN_ERR "bn = %Lx, index = %d\n",
btstack->stack[i].bn,
btstack->stack[i].index);
}
/* retrieve search results */ /* retrieve search results */
#define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)\ #define BT_GETSEARCH(IP, LEAF, BN, MP, TYPE, P, INDEX, ROOT)\
{\ {\
......
/* /*
* Copyright (C) International Business Machines Corp., 2000-2003 * Copyright (C) International Business Machines Corp., 2000-2004
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -382,7 +382,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks) ...@@ -382,7 +382,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
IREAD_LOCK(ipbmap); IREAD_LOCK(ipbmap);
/* block to be freed better be within the mapsize. */ /* block to be freed better be within the mapsize. */
if (blkno + nblocks > bmp->db_mapsize) { if (unlikely((blkno == 0) || (blkno + nblocks > bmp->db_mapsize))) {
IREAD_UNLOCK(ipbmap); IREAD_UNLOCK(ipbmap);
printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n", printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
(unsigned long long) blkno, (unsigned long long) blkno,
......
/* /*
* Copyright (C) International Business Machines Corp., 2000-2003 * Copyright (C) International Business Machines Corp., 2000-2004
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -378,6 +378,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot) ...@@ -378,6 +378,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
* It's time to move the inline table to an external * It's time to move the inline table to an external
* page and begin to build the xtree * page and begin to build the xtree
*/ */
if (dbAlloc(ip, 0, sbi->nbperpage, &xaddr))
goto clean_up; /* No space */
/* /*
* Save the table, we're going to overwrite it with the * Save the table, we're going to overwrite it with the
...@@ -394,8 +396,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot) ...@@ -394,8 +396,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
/* /*
* Allocate the first block & add it to the xtree * Allocate the first block & add it to the xtree
*/ */
xaddr = 0;
if (xtInsert(tid, ip, 0, 0, sbi->nbperpage, &xaddr, 0)) { if (xtInsert(tid, ip, 0, 0, sbi->nbperpage, &xaddr, 0)) {
/* This really shouldn't fail */
jfs_warn("add_index: xtInsert failed!"); jfs_warn("add_index: xtInsert failed!");
memcpy(&jfs_ip->i_dirtable, temp_table, memcpy(&jfs_ip->i_dirtable, temp_table,
sizeof (temp_table)); sizeof (temp_table));
...@@ -764,11 +766,12 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data, ...@@ -764,11 +766,12 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
*/ */
getChild: getChild:
/* update max. number of pages to split */ /* update max. number of pages to split */
if (btstack->nsplit >= 8) { if (BT_STACK_FULL(btstack)) {
/* Something's corrupted, mark filesytem dirty so /* Something's corrupted, mark filesytem dirty so
* chkdsk will fix it. * chkdsk will fix it.
*/ */
jfs_error(sb, "stack overrun in dtSearch!"); jfs_error(sb, "stack overrun in dtSearch!");
BT_STACK_DUMP(btstack);
rc = -EIO; rc = -EIO;
goto out; goto out;
} }
...@@ -975,8 +978,10 @@ static int dtSplitUp(tid_t tid, ...@@ -975,8 +978,10 @@ static int dtSplitUp(tid_t tid,
n -= DTROOTMAXSLOT - sp->header.freecnt; /* header + entries */ n -= DTROOTMAXSLOT - sp->header.freecnt; /* header + entries */
if (n <= split->nslot) if (n <= split->nslot)
xlen++; xlen++;
if ((rc = dbAlloc(ip, 0, (s64) xlen, &xaddr))) if ((rc = dbAlloc(ip, 0, (s64) xlen, &xaddr))) {
DT_PUTPAGE(smp);
goto freeKeyName; goto freeKeyName;
}
pxdlist.maxnpxd = 1; pxdlist.maxnpxd = 1;
pxdlist.npxd = 0; pxdlist.npxd = 0;
...@@ -3342,6 +3347,12 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack) ...@@ -3342,6 +3347,12 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack)
/* /*
* descend down to leftmost child page * descend down to leftmost child page
*/ */
if (BT_STACK_FULL(btstack)) {
DT_PUTPAGE(mp);
jfs_error(ip->i_sb, "dtReadFirst: btstack overrun");
BT_STACK_DUMP(btstack);
return -EIO;
}
/* push (bn, index) of the parent page/entry */ /* push (bn, index) of the parent page/entry */
BT_PUSH(btstack, bn, 0); BT_PUSH(btstack, bn, 0);
......
...@@ -239,6 +239,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, ...@@ -239,6 +239,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
spin_unlock(&meta_lock); spin_unlock(&meta_lock);
if (test_bit(META_stale, &mp->flag)) { if (test_bit(META_stale, &mp->flag)) {
release_metapage(mp); release_metapage(mp);
yield(); /* Let other waiters release it, too */
goto again; goto again;
} }
if (test_bit(META_discard, &mp->flag)) { if (test_bit(META_discard, &mp->flag)) {
......
...@@ -1747,7 +1747,10 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -1747,7 +1747,10 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
if (lwm == next) if (lwm == next)
goto out; goto out;
assert(lwm < next); if (lwm > next) {
jfs_err("xtLog: lwm > next\n");
goto out;
}
tlck->flag |= tlckUPDATEMAP; tlck->flag |= tlckUPDATEMAP;
xadlock->flag = mlckALLOCXADLIST; xadlock->flag = mlckALLOCXADLIST;
xadlock->count = next - lwm; xadlock->count = next - lwm;
...@@ -1913,11 +1916,8 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -1913,11 +1916,8 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
/* /*
* write log records * write log records
*/ */
/*
* allocate entries XAD[lwm:next]:
*/
if (lwm < next) {
/* log after-image for logredo(): /* log after-image for logredo():
*
* logredo() will update bmap for alloc of new/extended * logredo() will update bmap for alloc of new/extended
* extents (XAD_NEW|XAD_EXTEND) of XAD[lwm:next) from * extents (XAD_NEW|XAD_EXTEND) of XAD[lwm:next) from
* after-image of XADlist; * after-image of XADlist;
...@@ -1926,12 +1926,8 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd, ...@@ -1926,12 +1926,8 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
*/ */
lrd->type = cpu_to_le16(LOG_REDOPAGE); lrd->type = cpu_to_le16(LOG_REDOPAGE);
PXDaddress(pxd, mp->index); PXDaddress(pxd, mp->index);
PXDlength(pxd, PXDlength(pxd, mp->logical_size >> tblk->sb->s_blocksize_bits);
mp->logical_size >> tblk->sb-> lrd->backchain = cpu_to_le32(lmLog(log, tblk, lrd, tlck));
s_blocksize_bits);
lrd->backchain =
cpu_to_le32(lmLog(log, tblk, lrd, tlck));
}
/* /*
* truncate entry XAD[twm == next - 1]: * truncate entry XAD[twm == next - 1]:
...@@ -2624,6 +2620,7 @@ void txAbort(tid_t tid, int dirty) ...@@ -2624,6 +2620,7 @@ void txAbort(tid_t tid, int dirty)
lid_t lid, next; lid_t lid, next;
struct metapage *mp; struct metapage *mp;
struct tblock *tblk = tid_to_tblock(tid); struct tblock *tblk = tid_to_tblock(tid);
struct tlock *tlck;
jfs_warn("txAbort: tid:%d dirty:0x%x", tid, dirty); jfs_warn("txAbort: tid:%d dirty:0x%x", tid, dirty);
...@@ -2631,9 +2628,10 @@ void txAbort(tid_t tid, int dirty) ...@@ -2631,9 +2628,10 @@ void txAbort(tid_t tid, int dirty)
* free tlocks of the transaction * free tlocks of the transaction
*/ */
for (lid = tblk->next; lid; lid = next) { for (lid = tblk->next; lid; lid = next) {
next = lid_to_tlock(lid)->next; tlck = lid_to_tlock(lid);
next = tlck->next;
mp = lid_to_tlock(lid)->mp; mp = tlck->mp;
JFS_IP(tlck->ip)->xtlid = 0;
if (mp) { if (mp) {
mp->lid = 0; mp->lid = 0;
......
...@@ -113,11 +113,12 @@ typedef struct { ...@@ -113,11 +113,12 @@ typedef struct {
#define addressPXD(pxd)\ #define addressPXD(pxd)\
( ((s64)((pxd)->addr1)) << 32 | __le32_to_cpu((pxd)->addr2)) ( ((s64)((pxd)->addr1)) << 32 | __le32_to_cpu((pxd)->addr2))
#define MAXTREEHEIGHT 8
/* pxd list */ /* pxd list */
struct pxdlist { struct pxdlist {
s16 maxnpxd; s16 maxnpxd;
s16 npxd; s16 npxd;
pxd_t pxd[8]; pxd_t pxd[MAXTREEHEIGHT];
}; };
......
...@@ -858,7 +858,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -858,7 +858,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
unchar *i_fastsymlink; unchar *i_fastsymlink;
s64 xlen = 0; s64 xlen = 0;
int bmask = 0, xsize; int bmask = 0, xsize;
s64 xaddr; s64 extent = 0, xaddr;
struct metapage *mp; struct metapage *mp;
struct super_block *sb; struct super_block *sb;
struct tblock *tblk; struct tblock *tblk;
...@@ -892,29 +892,11 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -892,29 +892,11 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
down(&JFS_IP(dip)->commit_sem); down(&JFS_IP(dip)->commit_sem);
down(&JFS_IP(ip)->commit_sem); down(&JFS_IP(ip)->commit_sem);
if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE)))
goto out3;
tblk = tid_to_tblock(tid); tblk = tid_to_tblock(tid);
tblk->xflag |= COMMIT_CREATE; tblk->xflag |= COMMIT_CREATE;
tblk->ino = ip->i_ino; tblk->ino = ip->i_ino;
tblk->u.ixpxd = JFS_IP(ip)->ixpxd; tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
/*
* create entry for symbolic link in parent directory
*/
ino = ip->i_ino;
if ((rc = dtInsert(tid, dip, &dname, &ino, &btstack))) {
jfs_err("jfs_symlink: dtInsert returned %d", rc);
/* discard ne inode */
goto out3;
}
/* fix symlink access permission /* fix symlink access permission
* (dir_create() ANDs in the u.u_cmask, * (dir_create() ANDs in the u.u_cmask,
* but symlinks really need to be 777 access) * but symlinks really need to be 777 access)
...@@ -966,37 +948,48 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -966,37 +948,48 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
xsize = (ssize + bmask) & ~bmask; xsize = (ssize + bmask) & ~bmask;
xaddr = 0; xaddr = 0;
xlen = xsize >> JFS_SBI(sb)->l2bsize; xlen = xsize >> JFS_SBI(sb)->l2bsize;
if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0)) == 0) { if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0))) {
txAbort(tid, 0);
rc = -ENOSPC;
goto out3;
}
extent = xaddr;
ip->i_size = ssize - 1; ip->i_size = ssize - 1;
while (ssize) { while (ssize) {
/* This is kind of silly since PATH_MAX == 4K */
int copy_size = min(ssize, PSIZE); int copy_size = min(ssize, PSIZE);
mp = get_metapage(ip, xaddr, PSIZE, 1); mp = get_metapage(ip, xaddr, PSIZE, 1);
if (mp == NULL) { if (mp == NULL) {
dtDelete(tid, dip, &dname, &ino, dbFree(ip, extent, xlen);
JFS_REMOVE);
rc = -EIO; rc = -EIO;
txAbort(tid, 0);
goto out3; goto out3;
} }
memcpy(mp->data, name, copy_size); memcpy(mp->data, name, copy_size);
flush_metapage(mp); flush_metapage(mp);
#if 0
set_buffer_uptodate(bp);
mark_buffer_dirty(bp, 1);
if (IS_SYNC(dip))
sync_dirty_buffer(bp);
brelse(bp);
#endif /* 0 */
ssize -= copy_size; ssize -= copy_size;
name += copy_size;
xaddr += JFS_SBI(sb)->nbperpage; xaddr += JFS_SBI(sb)->nbperpage;
} }
ip->i_blocks = LBLK2PBLK(sb, xlen); ip->i_blocks = LBLK2PBLK(sb, xlen);
} else {
dtDelete(tid, dip, &dname, &ino, JFS_REMOVE);
rc = -ENOSPC;
goto out3;
} }
/*
* create entry for symbolic link in parent directory
*/
rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE);
if (rc == 0) {
ino = ip->i_ino;
rc = dtInsert(tid, dip, &dname, &ino, &btstack);
}
if (rc) {
if (xlen)
dbFree(ip, extent, xlen);
txAbort(tid, 0);
/* discard new inode */
goto out3;
} }
insert_inode_hash(ip); insert_inode_hash(ip);
...@@ -1004,23 +997,11 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry, ...@@ -1004,23 +997,11 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,
/* /*
* commit update of parent directory and link object * commit update of parent directory and link object
*
* if extent allocation failed (ENOSPC),
* the parent inode is committed regardless to avoid
* backing out parent directory update (by dtInsert())
* and subsequent dtDelete() which is harmless wrt
* integrity concern.
* the symlink inode will be freed by iput() at exit
* as it has a zero link count (by dtDelete()) and
* no permanant resources.
*/ */
iplist[0] = dip; iplist[0] = dip;
if (rc == 0) {
iplist[1] = ip; iplist[1] = ip;
rc = txCommit(tid, 2, &iplist[0], 0); rc = txCommit(tid, 2, &iplist[0], 0);
} else
rc = txCommit(tid, 1, &iplist[0], 0);
out3: out3:
txEnd(tid); txEnd(tid);
...@@ -1223,7 +1204,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1223,7 +1204,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
/* Linelock header of dtree */ /* Linelock header of dtree */
tlck = txLock(tid, old_ip, tlck = txLock(tid, old_ip,
(struct metapage *) &JFS_IP(old_ip)->bxflag, (struct metapage *) &JFS_IP(old_ip)->bxflag,
tlckDTREE | tlckBTROOT); tlckDTREE | tlckBTROOT | tlckRELINK);
dtlck = (struct dt_lock *) & tlck->lock; dtlck = (struct dt_lock *) & tlck->lock;
ASSERT(dtlck->index == 0); ASSERT(dtlck->index == 0);
lv = & dtlck->lv[0]; lv = & dtlck->lv[0];
......
...@@ -688,17 +688,26 @@ static int can_set_system_xattr(struct inode *inode, const char *name, ...@@ -688,17 +688,26 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
} }
inode->i_mode = mode; inode->i_mode = mode;
mark_inode_dirty(inode); mark_inode_dirty(inode);
if (rc == 0)
value = NULL;
} }
/* /*
* We're changing the ACL. Get rid of the cached one * We're changing the ACL. Get rid of the cached one
*/ */
acl =JFS_IP(inode)->i_acl; acl =JFS_IP(inode)->i_acl;
if (acl && (acl != JFS_ACL_NOT_CACHED)) if (acl != JFS_ACL_NOT_CACHED)
posix_acl_release(acl); posix_acl_release(acl);
JFS_IP(inode)->i_acl = JFS_ACL_NOT_CACHED; JFS_IP(inode)->i_acl = JFS_ACL_NOT_CACHED;
return 0;
} else if (strcmp(name, XATTR_NAME_ACL_DEFAULT) == 0) { } else if (strcmp(name, XATTR_NAME_ACL_DEFAULT) == 0) {
acl = posix_acl_from_xattr(value, value_len);
if (IS_ERR(acl)) {
rc = PTR_ERR(acl);
printk(KERN_ERR "posix_acl_from_xattr returned %d\n",
rc);
return rc;
}
posix_acl_release(acl);
/* /*
* We're changing the default ACL. Get rid of the cached one * We're changing the default ACL. Get rid of the cached one
*/ */
...@@ -706,13 +715,11 @@ static int can_set_system_xattr(struct inode *inode, const char *name, ...@@ -706,13 +715,11 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
if (acl && (acl != JFS_ACL_NOT_CACHED)) if (acl && (acl != JFS_ACL_NOT_CACHED))
posix_acl_release(acl); posix_acl_release(acl);
JFS_IP(inode)->i_default_acl = JFS_ACL_NOT_CACHED; JFS_IP(inode)->i_default_acl = JFS_ACL_NOT_CACHED;
} else
/* Invalid xattr name */
return -EINVAL;
return 0; return 0;
#else /* CONFIG_JFS_POSIX_ACL */ }
return -EOPNOTSUPP;
#endif /* CONFIG_JFS_POSIX_ACL */ #endif /* CONFIG_JFS_POSIX_ACL */
return -EOPNOTSUPP;
} }
static int can_set_xattr(struct inode *inode, const char *name, static int can_set_xattr(struct inode *inode, const char *name,
......
...@@ -314,7 +314,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc) ...@@ -314,7 +314,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
if (err >= 0) { if (err >= 0) {
err = 0; err = 0;
if (wbc->for_reclaim) if (wbc->for_reclaim)
err = WRITEPAGE_ACTIVATE; nfs_flush_inode(inode, 0, 0, FLUSH_STABLE);
} }
} else { } else {
err = nfs_writepage_sync(NULL, inode, page, 0, err = nfs_writepage_sync(NULL, inode, page, 0,
...@@ -327,7 +327,6 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc) ...@@ -327,7 +327,6 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
} }
unlock_kernel(); unlock_kernel();
out: out:
if (err != WRITEPAGE_ACTIVATE)
unlock_page(page); unlock_page(page);
if (inode_referenced) if (inode_referenced)
iput(inode); iput(inode);
......
...@@ -307,7 +307,7 @@ static inline void out_le32(volatile unsigned *addr, int val) ...@@ -307,7 +307,7 @@ static inline void out_le32(volatile unsigned *addr, int val)
static inline void out_be32(volatile unsigned *addr, int val) static inline void out_be32(volatile unsigned *addr, int val)
{ {
__asm__ __volatile__("stw%U0%X0 %1,%0; eieio" __asm__ __volatile__("stw%U0%X0 %1,%0; sync"
: "=m" (*addr) : "r" (val)); : "=m" (*addr) : "r" (val));
} }
...@@ -356,9 +356,9 @@ static inline void out_le64(volatile unsigned long *addr, unsigned long val) ...@@ -356,9 +356,9 @@ static inline void out_le64(volatile unsigned long *addr, unsigned long val)
: "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr)); : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr));
} }
static inline void out_be64(volatile unsigned long *addr, int val) static inline void out_be64(volatile unsigned long *addr, unsigned long val)
{ {
__asm__ __volatile__("std %1,0(%0); sync" : "=m" (*addr) : "r" (val)); __asm__ __volatile__("std%U0%X0 %1,%0; sync" : "=m" (*addr) : "r" (val));
} }
#ifndef CONFIG_PPC_ISERIES #ifndef CONFIG_PPC_ISERIES
......
...@@ -1853,8 +1853,11 @@ ...@@ -1853,8 +1853,11 @@
#define PCI_DEVICE_ID_TIGON3_5750 0x1676 #define PCI_DEVICE_ID_TIGON3_5750 0x1676
#define PCI_DEVICE_ID_TIGON3_5751 0x1677 #define PCI_DEVICE_ID_TIGON3_5751 0x1677
#define PCI_DEVICE_ID_TIGON3_5750M 0x167c #define PCI_DEVICE_ID_TIGON3_5750M 0x167c
#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
#define PCI_DEVICE_ID_TIGON3_5782 0x1696 #define PCI_DEVICE_ID_TIGON3_5782 0x1696
#define PCI_DEVICE_ID_TIGON3_5788 0x169c #define PCI_DEVICE_ID_TIGON3_5788 0x169c
#define PCI_DEVICE_ID_TIGON3_5789 0x169d
#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
......
...@@ -839,7 +839,7 @@ shrink_zone(struct zone *zone, struct scan_control *sc) ...@@ -839,7 +839,7 @@ shrink_zone(struct zone *zone, struct scan_control *sc)
if (count >= SWAP_CLUSTER_MAX) { if (count >= SWAP_CLUSTER_MAX) {
atomic_set(&zone->nr_scan_inactive, 0); atomic_set(&zone->nr_scan_inactive, 0);
sc->nr_to_scan = count; sc->nr_to_scan = count;
return shrink_cache(zone, sc); shrink_cache(zone, sc);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment