Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NET]: Fix networking compilation errors
  [AF_RXRPC/AFS]: Arch-specific fixes.
  [AFS]: Fix VLocation record update wakeup
  [NET]: Revert sk_buff walker cleanups.
  • Loading branch information
Linus Torvalds committed Apr 27, 2007
2 parents f005463 + b8b8fd2 commit 42fae7f
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 99 deletions.
2 changes: 2 additions & 0 deletions arch/ia64/lib/csum_partial_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ csum_partial_copy_from_user(const void __user *src, void *dst,
return (__force __wsum)result;
}

EXPORT_SYMBOL(csum_partial_copy_from_user);

__wsum
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
{
Expand Down
1 change: 1 addition & 0 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,7 @@ config AFS_FS
tristate "Andrew File System support (AFS) (EXPERIMENTAL)"
depends on INET && EXPERIMENTAL
select AF_RXRPC
select KEYS
help
If you say Y here, you will get an experimental Andrew File System
driver. It currently only supports unsecured read-only AFS access.
Expand Down
2 changes: 1 addition & 1 deletion fs/afs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ struct afs_uuid {
u32 time_low; /* low part of timestamp */
u16 time_mid; /* mid part of timestamp */
u16 time_hi_and_version; /* high part of timestamp and version */
#define AFS_UUID_TO_UNIX_TIME 0x01b21dd213814000
#define AFS_UUID_TO_UNIX_TIME 0x01b21dd213814000ULL
#define AFS_UUID_TIMEHI_MASK 0x0fff
#define AFS_UUID_VERSION_TIME 0x1000 /* time-based UUID */
#define AFS_UUID_VERSION_NAME 0x3000 /* name-based UUID */
Expand Down
2 changes: 1 addition & 1 deletion fs/afs/rxrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ int afs_extract_data(struct afs_call *call, struct sk_buff *skb,

if (call->offset < count) {
if (last) {
_leave(" = -EBADMSG [%d < %lu]", call->offset, count);
_leave(" = -EBADMSG [%d < %zu]", call->offset, count);
return -EBADMSG;
}
_leave(" = -EAGAIN");
Expand Down
2 changes: 1 addition & 1 deletion fs/afs/use-rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static int afs_read_rtm(struct afs_rtm_desc *desc)
desc->datalen = kernel_recvmsg(desc->nlsock, &msg, iov, 1,
desc->datamax, 0);
if (desc->datalen < 0) {
_leave(" = %ld [recv]", desc->datalen);
_leave(" = %zd [recv]", desc->datalen);
return desc->datalen;
}

Expand Down
17 changes: 8 additions & 9 deletions fs/afs/vlocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
goto error_abandon;
spin_lock(&vl->lock);
vl->state = AFS_VL_VALID;
wake_up(&vl->waitq);
spin_unlock(&vl->lock);
wake_up(&vl->waitq);

/* schedule for regular updates */
afs_vlocation_queue_for_updates(vl);
Expand All @@ -442,7 +442,7 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,

_debug("invalid [state %d]", state);

if ((state == AFS_VL_NEW || state == AFS_VL_NO_VOLUME)) {
if (state == AFS_VL_NEW || state == AFS_VL_NO_VOLUME) {
vl->state = AFS_VL_CREATING;
spin_unlock(&vl->lock);
goto fill_in_record;
Expand All @@ -453,11 +453,10 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
_debug("wait");

spin_unlock(&vl->lock);
ret = wait_event_interruptible(
vl->waitq,
vl->state == AFS_VL_NEW ||
vl->state == AFS_VL_VALID ||
vl->state == AFS_VL_NO_VOLUME);
ret = wait_event_interruptible(vl->waitq,
vl->state == AFS_VL_NEW ||
vl->state == AFS_VL_VALID ||
vl->state == AFS_VL_NO_VOLUME);
if (ret < 0)
goto error;
spin_lock(&vl->lock);
Expand All @@ -471,8 +470,8 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
error_abandon:
spin_lock(&vl->lock);
vl->state = AFS_VL_NEW;
wake_up(&vl->waitq);
spin_unlock(&vl->lock);
wake_up(&vl->waitq);
error:
ASSERT(vl != NULL);
afs_put_vlocation(vl);
Expand Down Expand Up @@ -675,7 +674,6 @@ static void afs_vlocation_updater(struct work_struct *work)
case 0:
afs_vlocation_apply_update(vl, &vldb);
vl->state = AFS_VL_VALID;
wake_up(&vl->waitq);
break;
case -ENOMEDIUM:
vl->state = AFS_VL_VOLUME_DELETED;
Expand All @@ -685,6 +683,7 @@ static void afs_vlocation_updater(struct work_struct *work)
break;
}
spin_unlock(&vl->lock);
wake_up(&vl->waitq);

/* and then reschedule */
_debug("reschedule");
Expand Down
2 changes: 1 addition & 1 deletion include/net/wext.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern int wext_proc_init(void);
extern int wext_handle_ioctl(struct ifreq *ifr, unsigned int cmd,
void __user *arg);
#else
static inline int wext_proc_init()
static inline int wext_proc_init(void)
{
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ ktime_t ktime_add_ns(const ktime_t kt, u64 nsec)

return ktime_add(kt, tmp);
}

EXPORT_SYMBOL_GPL(ktime_add_ns);
# endif /* !CONFIG_KTIME_SCALAR */

/*
Expand Down
25 changes: 16 additions & 9 deletions net/appletalk/ddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,11 @@ static unsigned long atalk_sum_partial(const unsigned char *data,
static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
int len, unsigned long sum)
{
int end = skb_headlen(skb);
int start = skb_headlen(skb);
int i, copy;

/* checksum stuff in header space */
if ((copy = end - offset) > 0) {
if ( (copy = start - offset) > 0) {
if (copy > len)
copy = len;
sum = atalk_sum_partial(skb->data + offset, copy, sum);
Expand All @@ -953,41 +953,48 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,

/* checksum stuff in frags */
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
BUG_TRAP(len >= 0);
int end;

end = offset + skb_shinfo(skb)->frags[i].size;
BUG_TRAP(start <= offset + len);

end = start + skb_shinfo(skb)->frags[i].size;
if ((copy = end - offset) > 0) {
u8 *vaddr;
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];

if (copy > len)
copy = len;
vaddr = kmap_skb_frag(frag);
sum = atalk_sum_partial(vaddr + frag->page_offset,
copy, sum);
sum = atalk_sum_partial(vaddr + frag->page_offset +
offset - start, copy, sum);
kunmap_skb_frag(vaddr);

if (!(len -= copy))
return sum;
offset += copy;
}
start = end;
}

if (skb_shinfo(skb)->frag_list) {
struct sk_buff *list = skb_shinfo(skb)->frag_list;

for (; list; list = list->next) {
BUG_TRAP(len >= 0);
int end;

BUG_TRAP(start <= offset + len);

end = offset + list->len;
end = start + list->len;
if ((copy = end - offset) > 0) {
if (copy > len)
copy = len;
sum = atalk_sum_skb(list, 0, copy, sum);
sum = atalk_sum_skb(list, offset - start,
copy, sum);
if ((len -= copy) == 0)
return sum;
offset += copy;
}
start = end;
}
}

Expand Down
50 changes: 33 additions & 17 deletions net/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ EXPORT_SYMBOL(skb_kill_datagram);
int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
struct iovec *to, int len)
{
int end = skb_headlen(skb);
int i, copy = end - offset;
int start = skb_headlen(skb);
int i, copy = start - offset;

/* Copy header. */
if (copy > 0) {
Expand All @@ -263,9 +263,11 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,

/* Copy paged appendix. Hmm... why does this look so complicated? */
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
BUG_TRAP(len >= 0);
int end;

end = offset + skb_shinfo(skb)->frags[i].size;
BUG_TRAP(start <= offset + len);

end = start + skb_shinfo(skb)->frags[i].size;
if ((copy = end - offset) > 0) {
int err;
u8 *vaddr;
Expand All @@ -275,33 +277,39 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
if (copy > len)
copy = len;
vaddr = kmap(page);
err = memcpy_toiovec(to, vaddr + frag->page_offset,
copy);
err = memcpy_toiovec(to, vaddr + frag->page_offset +
offset - start, copy);
kunmap(page);
if (err)
goto fault;
if (!(len -= copy))
return 0;
offset += copy;
}
start = end;
}

if (skb_shinfo(skb)->frag_list) {
struct sk_buff *list = skb_shinfo(skb)->frag_list;

for (; list; list = list->next) {
BUG_TRAP(len >= 0);
int end;

BUG_TRAP(start <= offset + len);

end = offset + list->len;
end = start + list->len;
if ((copy = end - offset) > 0) {
if (copy > len)
copy = len;
if (skb_copy_datagram_iovec(list, 0, to, copy))
if (skb_copy_datagram_iovec(list,
offset - start,
to, copy))
goto fault;
if ((len -= copy) == 0)
return 0;
offset += copy;
}
start = end;
}
}
if (!len)
Expand All @@ -315,9 +323,9 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
u8 __user *to, int len,
__wsum *csump)
{
int end = skb_headlen(skb);
int start = skb_headlen(skb);
int pos = 0;
int i, copy = end - offset;
int i, copy = start - offset;

/* Copy header. */
if (copy > 0) {
Expand All @@ -336,9 +344,11 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
}

for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
BUG_TRAP(len >= 0);
int end;

end = offset + skb_shinfo(skb)->frags[i].size;
BUG_TRAP(start <= offset + len);

end = start + skb_shinfo(skb)->frags[i].size;
if ((copy = end - offset) > 0) {
__wsum csum2;
int err = 0;
Expand All @@ -350,7 +360,8 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
copy = len;
vaddr = kmap(page);
csum2 = csum_and_copy_to_user(vaddr +
frag->page_offset,
frag->page_offset +
offset - start,
to, copy, 0, &err);
kunmap(page);
if (err)
Expand All @@ -362,20 +373,24 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
to += copy;
pos += copy;
}
start = end;
}

if (skb_shinfo(skb)->frag_list) {
struct sk_buff *list = skb_shinfo(skb)->frag_list;

for (; list; list=list->next) {
BUG_TRAP(len >= 0);
int end;

BUG_TRAP(start <= offset + len);

end = offset + list->len;
end = start + list->len;
if ((copy = end - offset) > 0) {
__wsum csum2 = 0;
if (copy > len)
copy = len;
if (skb_copy_and_csum_datagram(list, 0,
if (skb_copy_and_csum_datagram(list,
offset - start,
to, copy,
&csum2))
goto fault;
Expand All @@ -386,6 +401,7 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
to += copy;
pos += copy;
}
start = end;
}
}
if (!len)
Expand Down
Loading

0 comments on commit 42fae7f

Please sign in to comment.