El mié, 26-11-2008 a las 01:16 +0100, mariodebian escribió: > El mar, 25-11-2008 a las 18:28 +0100, Adeodato Simó escribió: > > * Ben Hutchings [Tue, 25 Nov 2008 02:21:21 +0000]: > > > > > Based on Eduard Bloch's comments to #482075 it does not appear that > > > cdfs-src can be fixed for lenny. > > > > Thanks for the notice. Will do, but let's CC Mario Izquierdo first. > > Apparently TCOS uses this, so maybe they've found some solution, or > > they've moved on to cddfs, or else. > > > > Cheers, > > > > > Hi again. > > > I send a mail to kernel commit author: > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12debc4248a4a7f1873e47cda2cdd7faca80b099 > > when iget and super_operations->read_inode was removed, I hope He can > help us to make CDFS work again. > > > Please wait until David answer us for CDFS patch. > > > Greetings Very good news !!!! David Howells send me some suggestions and code to make work CDFS again, and it works like a charm in 2.6.26-1-686 kernel. I'm very newie patching kernel stuff and he explain me some code bugs like a excelent teacher. David Howells is my personal hero for today. Many thanks David. ** FOR DEBIAN PEOPLE ** I will prepare new tcos-extra-modules package with CDFS patch: http://www.tcosproject.org/pool/main/t/tcos-extra-modules/ Please, don't remove cdfs from lenny. Cheers -- http://soleup.eup.uva.es/mariodebian
Sólo en cdfs.working/2.6: modules.order diff -ur cdfs/2.6/root.c cdfs.working/2.6/root.c --- cdfs/2.6/root.c 2006-10-24 21:41:12.000000000 +0200 +++ cdfs.working/2.6/root.c 2008-11-26 15:27:07.000000000 +0100 @@ -42,7 +42,9 @@ extern struct seq_operations cdfs_operations; extern struct _track_info *dummy_track_p; - +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,24) +struct inode *cdfs_iget(struct super_block *sp, unsigned long ino); +#endif /*============================================================================* * cdfs_open() * * Description: * @@ -125,6 +127,7 @@ struct cdrom_tocentry entry; int no_audio=0, no_data=0; cd * this_cd; + struct inode *retinode; PRINT("cdfs_mount\n"); @@ -361,8 +364,19 @@ sb->s_magic = CDFS_MAGIC; sb->s_flags |= MS_RDONLY; sb->s_op = &cdfs_ops; - sb->s_root = d_alloc_root(iget(sb, 0)); - + /* always get inode status */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,24) + retinode=cdfs_iget(sb, 0); +#else + retinode=iget(sb, 0); +#endif + if ( IS_ERR(retinode) ) + return PTR_ERR(retinode); + + PRINT("retinode = %ld\n", retinode->i_ino); + + sb->s_root = d_alloc_root(retinode); + cdfs_proc_cd = this_cd; #ifdef OLD_KERNEL @@ -455,18 +469,28 @@ int i; cd * this_cd = cdfs_info(dir->i_sb); - PRINT("cdfs_lookup %s ino=%ld -> ", dentry->d_name.name, dir->i_ino); + PRINT("cdfs_lookup %s ino=%ld \n", dentry->d_name.name, dir->i_ino); for(i=0; i<T2I(this_cd->tracks); i++) if (!(strcmp(this_cd->track[i].name, dentry->d_name.name))) { - if ((inode=iget(dir->i_sb, i))==NULL) { - return ERR_PTR(-EACCES); - } else { - d_add(dentry, inode); - return ERR_PTR(0); - } + goto found; } return ERR_PTR(-ENOENT); + +/* Use goto and read inode with iget()/cdfs_iget() */ +/* Thanks to David Howells for patch and Master class in his mail */ +found: +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,24) +inode = cdfs_iget(dir->i_sb, i); +if (IS_ERR(inode)) + return ERR_CAST(inode); +#else + inode = iget(dir->i_sb, i) + if (!inode) + return ERR_PTR(-ENOMEM); +#endif +d_add(dentry, inode); +return NULL; } @@ -483,10 +507,11 @@ /**************************************************************************/ + static void cdfs_read_inode(struct inode *i) { cd * this_cd = cdfs_info(i->i_sb); - //printk("this_cd = 0x%x\n\n\n", (unsigned)this_cd); + PRINT("this_cd = 0x%x\n", (unsigned)this_cd); PRINT("read inode %ld\n", i->i_ino); @@ -538,10 +563,33 @@ } } + +struct inode *cdfs_iget(struct super_block *sp, unsigned long ino) { + /* info from http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12debc4248a4a7f1873e47cda2cdd7faca80b099 */ + struct inode *i; + i = iget_locked(sp, ino); + if (!i) { + PRINT("cdfs_iget NOT inode\n"); + return ERR_PTR(-ENOMEM); + } + if (!(i->i_state & I_NEW)) { + PRINT("cdfs_iget NOT I_NEW\n"); + return i; + } + + PRINT("cdfs_iget BEFORE inode %ld\n", i->i_ino); + cdfs_read_inode(i); + PRINT("cdfs_iget AFTER inode %ld\n", i->i_ino); + return i; +} + + /******************************************************************/ static struct super_operations cdfs_ops = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) .read_inode = cdfs_read_inode, +#endif .put_super = cdfs_umount, .statfs = cdfs_statfs };
Attachment:
signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente