• Neil Brown's avatar
    [PATCH] nfsd4: move delegation decisions to lock_manager callbacks · 69058973
    Neil Brown authored
    Remove nfs4_check_deleg_recall().  Move its checks into __setlease() via two
    new lock_manager callbacks, fl_mylease and fl_change, so that all leases (not
    just NFSv4 lease as with nfs4_check_deleg_recall) are checked.  Default
    implementations of fl_mylease and fl_change are provided for the sake of the
    fcntl_setlease interface.  Both callbacks must always be defined.
    
    fl_mylease: 
    
       for the NFSv4 server, this check is used to see if an existing lease
       comes from the same client.  For the fcntl_setlease interface, the existing
       logic is preserved.  the fl_mylease check sees if the existing lease is
       from the input filp.
    
    fl_change: called if the fl_mylease returns true
    
       the NFSv4 server does not hand out a delegation to a client that already
       has one.  -EAGAIN is returned.  Otherwise lease_modify is used.  For the
       fcntl_setlease interface, the exisiting logic is preserved: The callback
       used in lease_modify().
    Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
    Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    69058973
nfs4state.c 87 KB