Commit d51b8f84 authored by David S. Miller's avatar David S. Miller

Merge bk://kernel.bkbits.net/acme/net-2.5

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents ca8658e8 c87ec979
VERSION = 2 VERSION = 2
PATCHLEVEL = 5 PATCHLEVEL = 5
SUBLEVEL = 71 SUBLEVEL = 72
EXTRAVERSION = EXTRAVERSION =
# *DOCUMENTATION* # *DOCUMENTATION*
......
...@@ -297,13 +297,14 @@ int dm_hash_rename(const char *old, const char *new) ...@@ -297,13 +297,14 @@ int dm_hash_rename(const char *old, const char *new)
/* /*
* rename and move the name cell. * rename and move the name cell.
*/ */
unregister_with_devfs(hc);
list_del(&hc->name_list); list_del(&hc->name_list);
old_name = hc->name; old_name = hc->name;
hc->name = new_name; hc->name = new_name;
list_add(&hc->name_list, _name_buckets + hash_str(new_name)); list_add(&hc->name_list, _name_buckets + hash_str(new_name));
/* rename the device node in devfs */ /* rename the device node in devfs */
unregister_with_devfs(hc);
register_with_devfs(hc); register_with_devfs(hc);
up_write(&_hash_lock); up_write(&_hash_lock);
......
...@@ -952,8 +952,6 @@ static int bond_open(struct net_device *dev) ...@@ -952,8 +952,6 @@ static int bond_open(struct net_device *dev)
add_timer(alb_timer); add_timer(alb_timer);
} }
MOD_INC_USE_COUNT;
if (miimon > 0) { /* link check interval, in milliseconds. */ if (miimon > 0) { /* link check interval, in milliseconds. */
init_timer(timer); init_timer(timer);
timer->expires = jiffies + (miimon * HZ / 1000); timer->expires = jiffies + (miimon * HZ / 1000);
...@@ -1027,7 +1025,6 @@ static int bond_close(struct net_device *master) ...@@ -1027,7 +1025,6 @@ static int bond_close(struct net_device *master)
bond_alb_deinitialize(bond); bond_alb_deinitialize(bond);
} }
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
...@@ -3694,6 +3691,8 @@ static int __init bond_init(struct net_device *dev) ...@@ -3694,6 +3691,8 @@ static int __init bond_init(struct net_device *dev)
kfree(bond); kfree(bond);
return -ENOMEM; return -ENOMEM;
} }
bond->bond_proc_dir->owner = THIS_MODULE;
bond->bond_proc_info_file = bond->bond_proc_info_file =
create_proc_info_entry("info", 0, bond->bond_proc_dir, create_proc_info_entry("info", 0, bond->bond_proc_dir,
bond_get_info); bond_get_info);
...@@ -3705,6 +3704,7 @@ static int __init bond_init(struct net_device *dev) ...@@ -3705,6 +3704,7 @@ static int __init bond_init(struct net_device *dev)
kfree(bond); kfree(bond);
return -ENOMEM; return -ENOMEM;
} }
bond->bond_proc_info_file->owner = THIS_MODULE;
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
if (first_pass == 1) { if (first_pass == 1) {
......
...@@ -630,7 +630,7 @@ static void shaper_init_priv(struct net_device *dev) ...@@ -630,7 +630,7 @@ static void shaper_init_priv(struct net_device *dev)
* Add a shaper device to the system * Add a shaper device to the system
*/ */
static int __init shaper_probe(struct net_device *dev) static void __init shaper_setup(struct net_device *dev)
{ {
/* /*
* Set up the shaper. * Set up the shaper.
...@@ -642,6 +642,7 @@ static int __init shaper_probe(struct net_device *dev) ...@@ -642,6 +642,7 @@ static int __init shaper_probe(struct net_device *dev)
dev->open = shaper_open; dev->open = shaper_open;
dev->stop = shaper_close; dev->stop = shaper_close;
dev->destructor = (void (*)(struct net_device *))kfree;
dev->hard_start_xmit = shaper_start_xmit; dev->hard_start_xmit = shaper_start_xmit;
dev->get_stats = shaper_get_stats; dev->get_stats = shaper_get_stats;
dev->set_multicast_list = NULL; dev->set_multicast_list = NULL;
...@@ -669,12 +670,6 @@ static int __init shaper_probe(struct net_device *dev) ...@@ -669,12 +670,6 @@ static int __init shaper_probe(struct net_device *dev)
dev->addr_len = 0; dev->addr_len = 0;
dev->tx_queue_len = 10; dev->tx_queue_len = 10;
dev->flags = 0; dev->flags = 0;
/*
* Shaper is ok
*/
return 0;
} }
static int shapers = 1; static int shapers = 1;
...@@ -695,35 +690,38 @@ __setup("shapers=", set_num_shapers); ...@@ -695,35 +690,38 @@ __setup("shapers=", set_num_shapers);
#endif /* MODULE */ #endif /* MODULE */
static struct net_device *devs; static struct net_device **devs;
static unsigned int shapers_registered = 0; static unsigned int shapers_registered = 0;
static int __init shaper_init(void) static int __init shaper_init(void)
{ {
int i, err; int i;
size_t alloc_size; size_t alloc_size;
struct shaper *sp; struct net_device *dev;
char name[IFNAMSIZ];
if (shapers < 1) if (shapers < 1)
return -ENODEV; return -ENODEV;
alloc_size = (sizeof(*devs) * shapers) + alloc_size = sizeof(*dev) * shapers;
(sizeof(struct shaper) * shapers);
devs = kmalloc(alloc_size, GFP_KERNEL); devs = kmalloc(alloc_size, GFP_KERNEL);
if (!devs) if (!devs)
return -ENOMEM; return -ENOMEM;
memset(devs, 0, alloc_size); memset(devs, 0, alloc_size);
sp = (struct shaper *) &devs[shapers];
for (i = 0; i < shapers; i++) { for (i = 0; i < shapers; i++) {
err = dev_alloc_name(&devs[i], "shaper%d");
if (err < 0) snprintf(name, IFNAMSIZ, "shaper%d", i);
dev = alloc_netdev(sizeof(struct shaper), name,
shaper_setup);
if (!dev)
break; break;
devs[i].init = shaper_probe;
devs[i].priv = &sp[i]; if (register_netdev(dev))
if (register_netdev(&devs[i]))
break; break;
devs[i] = dev;
shapers_registered++; shapers_registered++;
} }
...@@ -740,7 +738,8 @@ static void __exit shaper_exit (void) ...@@ -740,7 +738,8 @@ static void __exit shaper_exit (void)
int i; int i;
for (i = 0; i < shapers_registered; i++) for (i = 0; i < shapers_registered; i++)
unregister_netdev(&devs[i]); if (devs[i])
unregister_netdev(devs[i]);
kfree(devs); kfree(devs);
devs = NULL; devs = NULL;
......
...@@ -985,6 +985,8 @@ static inline int check_sticky(struct inode *dir, struct inode *inode) ...@@ -985,6 +985,8 @@ static inline int check_sticky(struct inode *dir, struct inode *inode)
* 7. If we were asked to remove a directory and victim isn't one - ENOTDIR. * 7. If we were asked to remove a directory and victim isn't one - ENOTDIR.
* 8. If we were asked to remove a non-directory and victim isn't one - EISDIR. * 8. If we were asked to remove a non-directory and victim isn't one - EISDIR.
* 9. We can't remove a root or mountpoint. * 9. We can't remove a root or mountpoint.
* 10. We don't allow removal of NFS sillyrenamed files; it's handled by
* nfs_async_unlink().
*/ */
static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir) static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir)
{ {
...@@ -1008,6 +1010,8 @@ static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir) ...@@ -1008,6 +1010,8 @@ static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir)
return -EISDIR; return -EISDIR;
if (IS_DEADDIR(dir)) if (IS_DEADDIR(dir))
return -ENOENT; return -ENOENT;
if (victim->d_flags & DCACHE_NFSFS_RENAMED)
return -EBUSY;
return 0; return 0;
} }
......
...@@ -715,7 +715,6 @@ __nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) ...@@ -715,7 +715,6 @@ __nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
if (fattr->valid & NFS_ATTR_FATTR_V4) if (fattr->valid & NFS_ATTR_FATTR_V4)
nfsi->change_attr = fattr->change_attr; nfsi->change_attr = fattr->change_attr;
inode->i_size = nfs_size_to_loff_t(fattr->size); inode->i_size = nfs_size_to_loff_t(fattr->size);
inode->i_mode = fattr->mode;
inode->i_nlink = fattr->nlink; inode->i_nlink = fattr->nlink;
inode->i_uid = fattr->uid; inode->i_uid = fattr->uid;
inode->i_gid = fattr->gid; inode->i_gid = fattr->gid;
......
...@@ -387,8 +387,17 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, ...@@ -387,8 +387,17 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
if (type == IGMPV3_ALLOW_NEW_SOURCES || if (type == IGMPV3_ALLOW_NEW_SOURCES ||
type == IGMPV3_BLOCK_OLD_SOURCES) type == IGMPV3_BLOCK_OLD_SOURCES)
return skb; return skb;
if (pmc->crcount || isquery) if (pmc->crcount || isquery) {
/* make sure we have room for group header and at
* least one source.
*/
if (skb && AVAILABLE(skb) < sizeof(struct igmpv3_grec)+
sizeof(__u32)) {
igmpv3_sendpack(skb);
skb = 0; /* add_grhead will get a new one */
}
skb = add_grhead(skb, pmc, type, &pgr); skb = add_grhead(skb, pmc, type, &pgr);
}
return skb; return skb;
} }
pih = skb ? (struct igmpv3_report *)skb->h.igmph : 0; pih = skb ? (struct igmpv3_report *)skb->h.igmph : 0;
......
...@@ -1321,8 +1321,17 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, ...@@ -1321,8 +1321,17 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
if (type == MLD2_ALLOW_NEW_SOURCES || if (type == MLD2_ALLOW_NEW_SOURCES ||
type == MLD2_BLOCK_OLD_SOURCES) type == MLD2_BLOCK_OLD_SOURCES)
return skb; return skb;
if (pmc->mca_crcount || isquery) if (pmc->mca_crcount || isquery) {
/* make sure we have room for group header and at
* least one source.
*/
if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)+
sizeof(struct in6_addr)) {
mld_sendpack(skb);
skb = 0; /* add_grhead will get a new one */
}
skb = add_grhead(skb, pmc, type, &pgr); skb = add_grhead(skb, pmc, type, &pgr);
}
return skb; return skb;
} }
pmr = skb ? (struct mld2_report *)skb->h.raw : 0; pmr = skb ? (struct mld2_report *)skb->h.raw : 0;
......
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