sockfd_lookup missing from older kernel patches
Hi,
I was updating a BlueZ package for the Sharp Zaurus PDAs that use the 2.4.18 kernel. The previous package had been using BlueZ libs and utils v2.3 and patch 2.4.18-mh8 and had been working ok.
With the latest userspace source and patch 2.4.18-mh15 I noticed the function sockfd_lookup had been removed from the sock.c files. This caused a unresolved symbol error upon loading the bnep module on the Zaurus.
I noticed in the comments on http://www.holtmann.org/linux/kernel/ that sockfd_lookup was removed on Dec 15, 2003 from kernel patches for kernels 2.4.22 and later. I presume this function has been moved into more central kernel code? Was this function supposed to be removed from the patches for kernels 2.4.21 and earlier (or at least kernel 2.4.18)?
When I stuck the code below back into bnep/sock.c the module loaded properly (although I need to test functionality a bit more as I got the code from the patch 2.4.18-mh8).
<<<<<
static inline struct socket *socki_lookup(struct inode *inode)
{
return &inode->u.socket_i;
}static struct socket *sockfd_lookup(int fd, int *err)
{
struct file *file;
struct inode *inode;
struct socket *sock;
if (!(file = fget(fd))) {
*err = -EBADF;
return NULL;
}
inode = file->f_dentry->d_inode;
if (!inode->i_sock || !(sock = socki_lookup(inode))) {
*err = -ENOTSOCK;
fput(file);
return NULL;
}
if (sock->file != file) {
printk(KERN_ERR "socki_lookup: socket file changed!\n");
sock->file = file;
}
return sock;
}Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Regards,
Signature · 12 lines
Colin Pinkney http://www.cpinkney.org.uk ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Bluez-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Colin,
Quoted 8 lines
I was updating a BlueZ package for the Sharp Zaurus PDAs that use the 2.4.18 kernel. The previous package had been using BlueZ libs and utils v2.3 and patch 2.4.18-mh8 and had been working ok.
With the latest userspace source and patch 2.4.18-mh15 I noticed the function
sockfd_lookuphad been removed from thesock.cfiles. This caused a unresolved symbol error upon loading the bnep module on the Zaurus.
Quoted 5 lines
I noticed in the comments on http://www.holtmann.org/linux/kernel/ that
sockfd_lookupwas removed on Dec 15, 2003 from kernel patches for kernels 2.4.22 and later. I presume this function has been moved into more central kernel code? Was this function supposed to be removed from the patches for kernels 2.4.21 and earlier (or at least kernel 2.4.18)?
all -mh patches for 2.4 should deal correctly with an exported or non exported sockfd_lookup(). I tested that a long time ago. However if you got problems with then simply export that function from the socket core.
Regards
Marcel
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel