Incomplete patch?
Incomplete patch?
Posted Mar 23, 2007 20:46 UTC (Fri) by giraffedata (guest, #1954)In reply to: Incomplete patch? by khim
Parent article: fallocate()
Have you looked at GCC sources ? That's where this code is, after all...
No, it's not. It's in the filesystem drivers, in the statement that declares the inode_operations variables. Looking to GCC source code for the setting of this member to NULL is like looking at at GCC source code to see the setting of 'a' to 7 in a program that contains the line "int a = 7;"
Hint: what does C standard says about initialization of static and globar structures ?
An even better hint is that all the filesystem drivers (I hope) initialize the inode operations field by assigning from a static constant inode_operations variable. Because that's not obvious, and is essential to this patch working.
Posted Mar 26, 2007 17:44 UTC (Mon)
by shishir (subscriber, #20844)
[Link] (1 responses)
Posted Mar 27, 2007 15:50 UTC (Tue)
by giraffedata (guest, #1954)
[Link]
i guess this might be a case where we assume that if a filesystem does not explicitly initialise the field, it is NULL, as the system call code does check for this field to be non-NULL. If it is NULL, it returns -ENOSYS. So, I guess, you are right in saying that there are certain per-filesystem patches that need to be installed.Incomplete patch?
Incomplete patch?
I guess this might be a case where we assume that if a filesystem does not explicitly initialise the field, it is NULL, as the system call code does check for this field to be non-NULL. If it is NULL, it returns ->ENOSYS. So, I guess, you are right in saying that there are certain per-filesystem patches that need to be installed.
So you're saying that the assumption that if a filesystem driver does not explicitly initialize the field, it is NULL, is wrong? What makes you think that?