linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* get_inode callback of generic_fh_to_{dentry|parent}
@ 2010-08-23 13:32 Marco Stornelli
  2010-08-23 14:10 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Stornelli @ 2010-08-23 13:32 UTC (permalink / raw)
  To: linux-fsdevel

Hi,

I'm the maintainer of pramfs. I'm currently working in the export
operation for my fs and I've got a question about the callback in the
subject. Is it right that this function return an error for a not
allocated inode? I see a comment for example in the ext2 code for the
callback like this:

  /* iget isn't really right if the inode is currently unallocated!! */

So I think it's cleaner to use ilookup() instead of iget(). Comments?

Thanks.

Marco

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

* Re: get_inode callback of generic_fh_to_{dentry|parent}
  2010-08-23 13:32 get_inode callback of generic_fh_to_{dentry|parent} Marco Stornelli
@ 2010-08-23 14:10 ` Christoph Hellwig
  2010-08-24  6:46   ` Marco Stornelli
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2010-08-23 14:10 UTC (permalink / raw)
  To: Marco Stornelli; +Cc: linux-fsdevel

On Mon, Aug 23, 2010 at 03:32:04PM +0200, Marco Stornelli wrote:
> Hi,
> 
> I'm the maintainer of pramfs. I'm currently working in the export
> operation for my fs and I've got a question about the callback in the
> subject. Is it right that this function return an error for a not
> allocated inode? I see a comment for example in the ext2 code for the
> callback like this:
> 
>   /* iget isn't really right if the inode is currently unallocated!! */
> 
> So I think it's cleaner to use ilookup() instead of iget(). Comments?

ilookup only returns an inode if it's already in the inode cache.
the get_inode callback needs to return an inode if it's allocated, even
if it's not in the inode cache.


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

* Re: get_inode callback of generic_fh_to_{dentry|parent}
  2010-08-23 14:10 ` Christoph Hellwig
@ 2010-08-24  6:46   ` Marco Stornelli
  0 siblings, 0 replies; 3+ messages in thread
From: Marco Stornelli @ 2010-08-24  6:46 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-fsdevel

2010/8/23 Christoph Hellwig <hch@infradead.org>:
> On Mon, Aug 23, 2010 at 03:32:04PM +0200, Marco Stornelli wrote:
>> Hi,
>>
>> I'm the maintainer of pramfs. I'm currently working in the export
>> operation for my fs and I've got a question about the callback in the
>> subject. Is it right that this function return an error for a not
>> allocated inode? I see a comment for example in the ext2 code for the
>> callback like this:
>>
>>   /* iget isn't really right if the inode is currently unallocated!! */
>>
>> So I think it's cleaner to use ilookup() instead of iget(). Comments?
>
> ilookup only returns an inode if it's already in the inode cache.
> the get_inode callback needs to return an inode if it's allocated, even
> if it's not in the inode cache.
>
>

Ok, right. However, it's not necessary to allocate it if it's not yet
allocated, it just needs to check if the inode is allocated and return
it, if I well understand.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2010-08-24  6:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 13:32 get_inode callback of generic_fh_to_{dentry|parent} Marco Stornelli
2010-08-23 14:10 ` Christoph Hellwig
2010-08-24  6:46   ` Marco Stornelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).