Skip to contentSkip to conversation

Two questions regarding Opening files within Kernel!

DISCUSSION JanuGerman 2 participants 2 messages Apr 7, 2007

lore
Share & tools
lore

JanuGerman

author
#0 lore raw

Thanks Jan for the response.

Quoted 1 line

struct dentry *foooobar = lookup_one_len("/foo/bar", current->fs->root);

But that gives me a dentry, where as file object is still not reachable.

Question: I am currently using a function called fs.h/dentry_open which takes a "dentry", "vfsmount" object and flag (usually RW i.e. 2), and gives me the file object. with your suggested method, vfsmount is still not available. In this regard, any idea about a function, which gives directly the file object instead of dentry will be highly appreciated.

OR, (Kindly see the code below), i need some thing for "missing vfsmount".

struct dentry *foooobar = lookup_one_len("/foo/bar", current->fs->root); struct file *file1 = dentry_open(foooobar, "missing vfsmount here",2)

Thanks,
JG

___________________________________________________________
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk

#1 lore raw
Quoted 6 lines · JanuGerman

Thanks Jan for the response.

Quoted 1 line

struct dentry *foooobar = lookup_one_len("/foo/bar", current->fs->root);

But that gives me a dentry, where as file object is still not reachable.

So use filp_open.

Quoted 22 lines

Question: I am currently using a function called fs.h/dentry_open which takes a "dentry", "vfsmount" object and flag (usually RW i.e. 2), and gives me the file object. with your suggested method, vfsmount is still not available. In this regard, any idea about a function, which gives directly the file object instead of dentry will be highly appreciated.

OR, (Kindly see the code below), i need some thing for "missing vfsmount".

   struct dentry *foooobar = lookup_one_len("/foo/bar", current->fs->root);
   struct file *file1 = dentry_open(foooobar, "missing vfsmount here",2)

Thanks,
JG

Quoted 4 lines

___________________________________________________________
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes.
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk

Jan