mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Chow <davidchow@shaolinmicro.com>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: "Peter J. Braam" <braam@clusterfs.com>,
	Jeff Garzik <jgarzik@mandrakesoft.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	phil@off.net
Subject: Re: tmpfs, NFS, file handles
Date: 21 Feb 2002 12:43:52 +0800	[thread overview]
Message-ID: <1014266633.17471.8.camel@star9.planet.rcn.com.hk> (raw)
In-Reply-To: <15476.10488.442232.634169@notabene.cse.unsw.edu.au>
In-Reply-To: <20020220094649.X25738@lustre.cfs> <3C73D548.648C5D64@mandrakesoft.com> <20020220122116.C28913@lustre.cfs>  <15476.10488.442232.634169@notabene.cse.unsw.edu.au>

在 週四, 2002-02-21 06:53, Neil Brown 寫道:
> On Wednesday February 20, braam@clusterfs.com wrote:
> > Hi, 
> > 
> > > "Peter J. Braam" wrote:
> > ...
> > > > Is there a suggested solution for fh_to_dentry and dentry_to_fh for
> > > > tmpfs?
> > > > 
> > > > An "iget" based solution might work but at present tmpfs inodes are
> > > > not hashed.
> > On Wed, Feb 20, 2002 at 11:56:40AM -0500, Jeff Garzik wrote:
> > ...
> > > I talked to neil brown about NFS and ramfs... he mentioned using
> > > iunique()
> ... but Trond had a better idea....
> > 
> > 
> > So do I understand that hashing tmpfs inodes is perhaps the way to go?
> > 
> > Would the following also work? 
> > 
> >  - have a 32 bit counter: set inode->i_ino to count++
> >  - up the generation number each time the counter warps. 
> 
> You don't just need a number in inode->i_ino.  You also need to be
> able to find an inode given that number.
> So you need to store all the inodes in a hash table.
> But you don't want to penalise non-NFS users.
> 
> I would probably:
>    leave i_ino as set by new_inode
>    initialise inode->i_generation to CURRENT_TIME
> 
>    in dentry_to_fh,
>      check if list_empty(&inode->i_hash)
>        if it is, then add the inode to some hash table indexed by the
>            address of the inode
>        put the address of the inode, i_ino and i_generation in the filehandle
> 
>    in fh_to_dentry,
>      lookup the given address in the hash table.
>      if it is found, check the i_ino and i_generation
> 
> 
> That means you are only hashing inodes exported by NFS, and you have
> a pretty good guarantee of uniqueness (providing time doesn't go
> backwards).
> 
> NeilBrown
> -
> 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

What I suggest is nfsd should export a symbol called
generic_fh_to_dentry() such that it will be more generic like
generic_file_read() to handle gneeric calls for every fs.

Thanks,

David


  parent reply	other threads:[~2002-02-21  4:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-20 16:46 Peter J. Braam
2002-02-20 16:56 ` Jeff Garzik
2002-02-20 19:21   ` Peter J. Braam
2002-02-20 19:42     ` Trond Myklebust
2002-02-20 22:53     ` Neil Brown
2002-02-21  4:43     ` David Chow [this message]
2002-02-21  5:04       ` Neil Brown
     [not found]         ` <3C790FB2.50503@rcn.com.hk>
2002-02-24 21:49           ` Neil Brown
2002-02-21  7:40     ` Christoph Rohland
2002-02-21 16:16 Lever, Charles
2002-02-21 22:58 ` Neil Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1014266633.17471.8.camel@star9.planet.rcn.com.hk \
    --to=davidchow@shaolinmicro.com \
    --cc=braam@clusterfs.com \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=phil@off.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®