Discussion:
error: structure has no member named ' refcount '
kishore
2005-12-22 05:36:59 UTC
Permalink
hi,

I am trying to compile LiS-2.18 (downloaded from gcom.com) on,
Redhat Enterprise Linux WS release 4 ( Nahant Update 2) with kernel version
2.6.9-16.EL .

I struck with an error while compiling LiS-2.18.

Error :
/usr/src/LiS-2.18/head/linux-mdep.c : 1001: error: struct has no member
named 'refcount'

I looked at LiS-2.18/head/linux-mdep.c ;the following line
printk(">> i->i_cdev: ***@0x%p/%d/%x \"%s\"\n",
inode->i_cdev,
K_ATOMIC_READ(&inode->i_cdev->kobj.refcount),
DEV_TO_INT(inode->i_cdev->dev),
(inode->i_cdev->owner ?
inode->i_cdev->owner->name : "No-Owner")) ;

will be executed only for kernel versions > 2.5.

I looked at lib/modules/`uname -r`/build/include/linux/kobject.h where
'struct kobject ' has no member with name 'refcount', i surprised, why LiS
is referring an undefined member in kobject.

Previously, I worked with the same LiS-2.18 on ES3 on kenel 2.4. It is lack
of troubles bcas the above code is for kernels > 2.5.

I went through gcom.com, they gave LiS-2.18 is compatible with 2.6 kernels
also. Can I know whether LiS-2.18 is compatible with the 2.6 kernel or not.

Can any one provide a solution to overcome this trouble.

regards,
kishore.
Paul Landay
2005-12-23 14:37:15 UTC
Permalink
See the archives of this mailing list.
http://www.mail-archive.com/cgi-bin/htsearch?method=and&format=short&config=linux-streams_gsyc_escet_urjc_es&restrict=&exclude=&words=refcount
This is what I do to /head/linux-mdep.c

@@ -998,7 +1001,11 @@
if (inode && inode->i_cdev)
printk(">> i->i_cdev: ***@0x%p/%d/%x \"%s\"\n",
inode->i_cdev,
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,8)
K_ATOMIC_READ(&inode->i_cdev->kobj.refcount),
+#else
+ K_ATOMIC_READ(&inode->i_cdev->kobj.kref.refcount),
+#endif
DEV_TO_INT(inode->i_cdev->dev),
(inode->i_cdev->owner ?
inode->i_cdev->owner->name : "No-Owner")) ;

Paul Landay

Loading...