linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Implementation of delegation
@ 2010-07-12 21:37 Yudong Gao
       [not found] ` <AANLkTik1dbBEnyqMEw9snDhjglJiDQJKs4dFdenqXaGJ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yudong Gao @ 2010-07-12 21:37 UTC (permalink / raw)
  To: linux-nfs

Hi,

I am reading the NFS source code of the file open function in kernel
2.6.34, but I cannot find any implementation with delegation to allow
client to open a file locally without contacting the server. We are
tying to use delegation to do something interesting. So I am wondering
how much delegation support specified in the NFS 4.1 protocol is
available in the current Linux implementation?

Thanks a lot!

best,

Yudong

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

* Re: Implementation of delegation
       [not found] ` <AANLkTik1dbBEnyqMEw9snDhjglJiDQJKs4dFdenqXaGJ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-07-12 21:48   ` Trond Myklebust
       [not found]     ` <1278971292.14605.2.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Trond Myklebust @ 2010-07-12 21:48 UTC (permalink / raw)
  To: Yudong Gao; +Cc: linux-nfs

On Mon, 2010-07-12 at 14:37 -0700, Yudong Gao wrote:
> Hi,
> 
> I am reading the NFS source code of the file open function in kernel
> 2.6.34, but I cannot find any implementation with delegation to allow
> client to open a file locally without contacting the server. We are
> tying to use delegation to do something interesting. So I am wondering
> how much delegation support specified in the NFS 4.1 protocol is
> available in the current Linux implementation?

What's wrong with nfs4_try_open_cached()? It even works with NFSv4.0...

Trond


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

* Re: Implementation of delegation
       [not found]     ` <1278971292.14605.2.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2010-07-12 22:00       ` Yudong Gao
  2010-07-12 22:07         ` Trond Myklebust
  0 siblings, 1 reply; 5+ messages in thread
From: Yudong Gao @ 2010-07-12 22:00 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

Hi Trond,

Thanks for the prompt reply!

I find that in _nfs_do_open(), _nfs4_proc_open(), which do the RPC
call to the remote server, is always called before
nfs4_opendata_to_nfs4_state(), which will further invoke
nfs4_try_open_cached().

Does this means that whenever is file is opened, the client always
need to talk to the server first?

Thanks!

best,

Yudong

On Mon, Jul 12, 2010 at 2:48 PM, Trond Myklebust
<trond.myklebust@fys.uio.no> wrote:
> On Mon, 2010-07-12 at 14:37 -0700, Yudong Gao wrote:
>> Hi,
>>
>> I am reading the NFS source code of the file open function in kernel
>> 2.6.34, but I cannot find any implementation with delegation to allow
>> client to open a file locally without contacting the server. We are
>> tying to use delegation to do something interesting. So I am wondering
>> how much delegation support specified in the NFS 4.1 protocol is
>> available in the current Linux implementation?
>
> What's wrong with nfs4_try_open_cached()? It even works with NFSv4.0...
>
> Trond
>
>

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

* Re: Implementation of delegation
  2010-07-12 22:00       ` Yudong Gao
@ 2010-07-12 22:07         ` Trond Myklebust
       [not found]           ` <1278972475.14605.9.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Trond Myklebust @ 2010-07-12 22:07 UTC (permalink / raw)
  To: Yudong Gao; +Cc: linux-nfs

On Mon, 2010-07-12 at 15:00 -0700, Yudong Gao wrote:
> Hi Trond,
> 
> Thanks for the prompt reply!
> 
> I find that in _nfs_do_open(), _nfs4_proc_open(), which do the RPC
> call to the remote server, is always called before
> nfs4_opendata_to_nfs4_state(), which will further invoke
> nfs4_try_open_cached().
> 
> Does this means that whenever is file is opened, the client always
> need to talk to the server first?

The actual RPC call is skipped if the call to can_open_cached() succeeds
in nfs4_open_prepare(). In that case, we just grab the sequence, which
ensures that we remain serialised w.r.t. CLOSE and OPEN_DOWNGRADE calls.

Trond


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

* Re: Implementation of delegation
       [not found]           ` <1278972475.14605.9.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2010-07-12 22:19             ` Yudong Gao
  0 siblings, 0 replies; 5+ messages in thread
From: Yudong Gao @ 2010-07-12 22:19 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs

I see! Thanks a lot for the pointer!

best,

Yudong

On Mon, Jul 12, 2010 at 3:07 PM, Trond Myklebust
<trond.myklebust@fys.uio.no> wrote:
> On Mon, 2010-07-12 at 15:00 -0700, Yudong Gao wrote:
>> Hi Trond,
>>
>> Thanks for the prompt reply!
>>
>> I find that in _nfs_do_open(), _nfs4_proc_open(), which do the RPC
>> call to the remote server, is always called before
>> nfs4_opendata_to_nfs4_state(), which will further invoke
>> nfs4_try_open_cached().
>>
>> Does this means that whenever is file is opened, the client always
>> need to talk to the server first?
>
> The actual RPC call is skipped if the call to can_open_cached() succeeds
> in nfs4_open_prepare(). In that case, we just grab the sequence, which
> ensures that we remain serialised w.r.t. CLOSE and OPEN_DOWNGRADE calls.
>
> Trond
>
>

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

end of thread, other threads:[~2010-07-12 22:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-12 21:37 Implementation of delegation Yudong Gao
     [not found] ` <AANLkTik1dbBEnyqMEw9snDhjglJiDQJKs4dFdenqXaGJ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-12 21:48   ` Trond Myklebust
     [not found]     ` <1278971292.14605.2.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-07-12 22:00       ` Yudong Gao
2010-07-12 22:07         ` Trond Myklebust
     [not found]           ` <1278972475.14605.9.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-07-12 22:19             ` Yudong Gao

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).