• J
    ceph: add a new flag to indicate whether parent is locked · 3dd69aab
    Jeff Layton 提交于
    struct ceph_mds_request has an r_locked_dir pointer, which is set to
    indicate the parent inode and that its i_rwsem is locked.  In some
    critical places, we need to be able to indicate the parent inode to the
    request handling code, even when its i_rwsem may not be locked.
    
    Most of the code that operates on r_locked_dir doesn't require that the
    i_rwsem be locked. We only really need it to handle manipulation of the
    dcache. The rest (filling of the inode, updating dentry leases, etc.)
    already has its own locking.
    
    Add a new r_req_flags bit that indicates whether the parent is locked
    when doing the request, and rename the pointer to "r_parent". For now,
    all the places that set r_parent also set this flag, but that will
    change in a later patch.
    Signed-off-by: NJeff Layton <jlayton@redhat.com>
    Reviewed-by: NYan, Zheng <zyan@redhat.com>
    Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
    3dd69aab
dir.c 39.5 KB