public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Two questions regarding Opening files within Kernel!
@ 2007-04-07 16:57 JanuGerman
  2007-04-07 18:44 ` Jan Engelhardt
  0 siblings, 1 reply; 6+ messages in thread
From: JanuGerman @ 2007-04-07 16:57 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linuxkernel

Thanks Jan for the response.


>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 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Two questions regarding Opening files within Kernel!
@ 2007-04-07  6:58 JanuGerman
  2007-04-07  9:22 ` Roland Kuhn
  2007-04-07 11:07 ` Jan Engelhardt
  0 siblings, 2 replies; 6+ messages in thread
From: JanuGerman @ 2007-04-07  6:58 UTC (permalink / raw)
  To: linuxkernel

Hi Every one,

  I have got two questions regarding opening files within the Linux kernel. If some body can help me, in sorting out this problem, i will be very thankful.

1)   I have just a file path with me, an absolute path, but no dentry, no inode, no vfsmount object, which function i can call to get a "file" object associated with the absoulte file path. I have surfed arround the source code especially fs/open.c and some other files, but each function requires a parameter "mode" and "fd" beside file path. Actually, i was confuse about the "mode" parameter (and its differece with "flag"), like what to send, and secondly for "fd", i am not sure, what value to send as there is no file infact and only file path exists. Any idea?

2) Any functionality within linux kernel source code, to read one line per file? or some indirect way to set buffer size for one read?. That is, any existing header file for doing text I/O rather than binary within the kernel source code?

Thanks,
JG


		
___________________________________________________________ 
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-04-07 18:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.9BBqigWhVcsOIUStQ9CipWD6PQo@ifi.uio.no>
2007-04-07 16:50 ` Two questions regarding Opening files within Kernel! Robert Hancock
2007-04-07 16:57 JanuGerman
2007-04-07 18:44 ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2007-04-07  6:58 JanuGerman
2007-04-07  9:22 ` Roland Kuhn
2007-04-07 11:07 ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox