Commit 47fc2491 authored by Ronnie Sahlberg's avatar Ronnie Sahlberg Committed by Steve French

cifs: improve handlecaching

Only track the dentry for the root handle
Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent aea6794e
...@@ -47,11 +47,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, ...@@ -47,11 +47,11 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
if (cifs_sb->root == NULL) if (cifs_sb->root == NULL)
return -ENOENT; return -ENOENT;
if (strlen(path)) if (!path[0])
dentry = cifs_sb->root;
else
return -ENOENT; return -ENOENT;
dentry = cifs_sb->root;
cfid = &tcon->cfids->cfid; cfid = &tcon->cfids->cfid;
mutex_lock(&cfid->fid_mutex); mutex_lock(&cfid->fid_mutex);
if (cfid->is_valid) { if (cfid->is_valid) {
...@@ -177,7 +177,8 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, ...@@ -177,7 +177,8 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
cfid->tcon = tcon; cfid->tcon = tcon;
cfid->is_valid = true; cfid->is_valid = true;
cfid->dentry = dentry; cfid->dentry = dentry;
dget(dentry); if (dentry)
dget(dentry);
kref_init(&cfid->refcount); kref_init(&cfid->refcount);
/* BB TBD check to see if oplock level check can be removed below */ /* BB TBD check to see if oplock level check can be removed below */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment