ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can anybody help me out by telling the exact macro name and location, by which I can gain control over the following kernel base level structure
1. strct super_block of Virtual File System, for super block object.
2. strct inode for inode ofject of VFS.
3 file structure for file object of VFS.
in addition to these if you know location to access other kernel structure.Please let me know.My main objective is to get the access to the structure pointer of these structure by which i can have access over the individual fields o these structure.
If you know some other mechanism to do same please let me know.
Thanks for the link you have provided its the good link.I didnt receive my purposeful information fron the same but I got from thehttp://www.gnugeneration.com/books/linux/2.6.20/filesystems/re44.html .But the thing is how these API can be implemented.Here only description has been provided, from which header fil it can be taken.. and other such type of information has not been provided here.Do you have some idea or some reference documents.If you have kindlt provide.. In the wait of that.
Can anybody help me where I am making wrong.I tried it all possible way..
Program :
#include<stdio.h>
#include</usr/include/sys/vfs.h>
int main()
{
char *path="/dev/hda1";
struct super_block *sb;
printf("Path = %s",path);
sb=get_super(path);
printf("Block size in bytes = %ld",sb->s_blocksize);
}
Error:
sp.c: In function ‘main’:
sp.c:8: warning: assignment makes pointer from integer without a cast
sp.c:9: error: dereferencing pointer to incomplete type
Below is a test program, with error produced.I understand that block_device pointer *bd sholuld get initialized.Program should produce initialization error for *bd. Compiler is producing '->'.I am not understanding why ?
Can anybody help me to get this program working fine ?
I have doubt of its working in user space as this program is accessing the kernel resources.
If anybody can provide me working code would be a great help, just to initiate things.Just a working this or any other kernel-API Code, would be a great help.
Its fine it become complicated, but its the direct way to implement, even if we are doing same with another variable at the place of *get_super(bd), i mean same type of pointer.Same error is being produced, even sometime s_blocksize is unrecognized.I have check same field with structure .So at least this error should not get produced.What you say? Do you ever tried some 2.6 kernel API , if yes kindly provide the way how you had done that or code.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.