Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92952
b: refs/heads/master
c: 076d842
h: refs/heads/master
v: v3
  • Loading branch information
Steve French committed Apr 18, 2008
1 parent 697ae97 commit dbcbf7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2302aca8508ee727a0c5edde3a7518a4ee03da1b
refs/heads/master: 076d8423a98659a92837b07aa494cb74bfefe77c
15 changes: 11 additions & 4 deletions trunk/fs/cifs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,14 @@ static void cifs_unix_info_to_inode(struct inode *inode,
spin_unlock(&inode->i_lock);
}

static const unsigned char *cifs_get_search_path(struct cifsTconInfo *pTcon,
const char *search_path)
static const unsigned char *cifs_get_search_path(struct cifs_sb_info *cifs_sb,
const char *search_path)
{
int tree_len;
int path_len;
int i;
char *tmp_path;
struct cifsTconInfo *pTcon = cifs_sb->tcon;

if (!(pTcon->Flags & SMB_SHARE_IS_IN_DFS))
return search_path;
Expand All @@ -180,6 +182,11 @@ static const unsigned char *cifs_get_search_path(struct cifsTconInfo *pTcon,
return search_path;

strncpy(tmp_path, pTcon->treeName, tree_len);
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
for (i = 0; i < tree_len; i++) {
if (tmp_path[i] == '\\')
tmp_path[i] = '/';
}
strncpy(tmp_path+tree_len, search_path, path_len);
tmp_path[tree_len+path_len] = 0;
return tmp_path;
Expand All @@ -199,7 +206,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
pTcon = cifs_sb->tcon;
cFYI(1, ("Getting info on %s", search_path));

full_path = cifs_get_search_path(pTcon, search_path);
full_path = cifs_get_search_path(cifs_sb, search_path);

try_again_CIFSSMBUnixQPathInfo:
/* could have done a find first instead but this returns more info */
Expand Down Expand Up @@ -402,7 +409,7 @@ int cifs_get_inode_info(struct inode **pinode,
return -ENOMEM;
pfindData = (FILE_ALL_INFO *)buf;

full_path = cifs_get_search_path(pTcon, search_path);
full_path = cifs_get_search_path(cifs_sb, search_path);

try_again_CIFSSMBQPathInfo:
/* could do find first instead but this returns more info */
Expand Down

0 comments on commit dbcbf7f

Please sign in to comment.