aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 22557716f9af..dec3c9dd04d7 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -148,6 +148,13 @@ static void fill_in_inode(struct inode *tmp_inode,
148 tmp_inode->i_mode = cifs_sb->mnt_dir_mode; 148 tmp_inode->i_mode = cifs_sb->mnt_dir_mode;
149 } 149 }
150 tmp_inode->i_mode |= S_IFDIR; 150 tmp_inode->i_mode |= S_IFDIR;
151 } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
152 (attr & ATTR_SYSTEM) && (end_of_file == 0)) {
153 *pobject_type = DT_FIFO;
154 tmp_inode->i_mode |= S_IFIFO;
155/* BB Finish for SFU style symlinks and devies */
156/* } else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) &&
157 (attr & ATTR_SYSTEM) && ) { */
151/* we no longer mark these because we could not follow them */ 158/* we no longer mark these because we could not follow them */
152/* } else if (attr & ATTR_REPARSE) { 159/* } else if (attr & ATTR_REPARSE) {
153 *pobject_type = DT_LNK; 160 *pobject_type = DT_LNK;
@@ -190,8 +197,9 @@ static void fill_in_inode(struct inode *tmp_inode,
190 tmp_inode->i_data.a_ops = &cifs_addr_ops; 197 tmp_inode->i_data.a_ops = &cifs_addr_ops;
191 198
192 if(isNewInode) 199 if(isNewInode)
193 return; /* No sense invalidating pages for new inode since we 200 return; /* No sense invalidating pages for new inode
194 have not started caching readahead file data yet */ 201 since have not started caching readahead file
202 data yet */
195 203
196 if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) && 204 if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) &&
197 (local_size == tmp_inode->i_size)) { 205 (local_size == tmp_inode->i_size)) {
@@ -353,7 +361,7 @@ static int initiate_cifs_search(const int xid, struct file *file)
353 return -EINVAL; 361 return -EINVAL;
354 362
355 down(&file->f_dentry->d_sb->s_vfs_rename_sem); 363 down(&file->f_dentry->d_sb->s_vfs_rename_sem);
356 full_path = build_path_from_dentry(file->f_dentry); 364 full_path = build_path_from_dentry(file->f_dentry, cifs_sb);
357 up(&file->f_dentry->d_sb->s_vfs_rename_sem); 365 up(&file->f_dentry->d_sb->s_vfs_rename_sem);
358 366
359 if(full_path == NULL) { 367 if(full_path == NULL) {
@@ -374,7 +382,7 @@ ffirst_retry:
374 382
375 rc = CIFSFindFirst(xid, pTcon,full_path,cifs_sb->local_nls, 383 rc = CIFSFindFirst(xid, pTcon,full_path,cifs_sb->local_nls,
376 &cifsFile->netfid, &cifsFile->srch_inf, 384 &cifsFile->netfid, &cifsFile->srch_inf,
377 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 385 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb));
378 if(rc == 0) 386 if(rc == 0)
379 cifsFile->invalidHandle = FALSE; 387 cifsFile->invalidHandle = FALSE;
380 if((rc == -EOPNOTSUPP) && 388 if((rc == -EOPNOTSUPP) &&
@@ -536,7 +544,8 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
536 while((index_to_find >= cifsFile->srch_inf.index_of_last_entry) && 544 while((index_to_find >= cifsFile->srch_inf.index_of_last_entry) &&
537 (rc == 0) && (cifsFile->srch_inf.endOfSearch == FALSE)){ 545 (rc == 0) && (cifsFile->srch_inf.endOfSearch == FALSE)){
538 cFYI(1,("calling findnext2")); 546 cFYI(1,("calling findnext2"));
539 rc = CIFSFindNext(xid,pTcon,cifsFile->netfid, &cifsFile->srch_inf); 547 rc = CIFSFindNext(xid,pTcon,cifsFile->netfid,
548 &cifsFile->srch_inf);
540 if(rc) 549 if(rc)
541 return -ENOENT; 550 return -ENOENT;
542 } 551 }
@@ -555,7 +564,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
555 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf)); 564 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf));
556 current_entry = cifsFile->srch_inf.srch_entries_start; 565 current_entry = cifsFile->srch_inf.srch_entries_start;
557 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) { 566 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) {
558 /* go entry to next entry figuring out which we need to start with */ 567 /* go entry by entry figuring out which is first */
559 /* if( . or ..) 568 /* if( . or ..)
560 skip */ 569 skip */
561 rc = cifs_entry_is_dot(current_entry,cifsFile); 570 rc = cifs_entry_is_dot(current_entry,cifsFile);
@@ -721,7 +730,8 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
721 (FILE_DIRECTORY_INFO *)pfindEntry,&obj_type, rc); 730 (FILE_DIRECTORY_INFO *)pfindEntry,&obj_type, rc);
722 } 731 }
723 732
724 rc = filldir(direntry,qstring.name,qstring.len,file->f_pos,tmp_inode->i_ino,obj_type); 733 rc = filldir(direntry,qstring.name,qstring.len,file->f_pos,
734 tmp_inode->i_ino,obj_type);
725 if(rc) { 735 if(rc) {
726 cFYI(1,("filldir rc = %d",rc)); 736 cFYI(1,("filldir rc = %d",rc));
727 } 737 }
@@ -906,7 +916,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
906 cifs_save_resume_key(current_entry,cifsFile); 916 cifs_save_resume_key(current_entry,cifsFile);
907 break; 917 break;
908 } else 918 } else
909 current_entry = nxt_dir_entry(current_entry,end_of_smb); 919 current_entry = nxt_dir_entry(current_entry,
920 end_of_smb);
910 } 921 }
911 kfree(tmp_buf); 922 kfree(tmp_buf);
912 break; 923 break;