Changeset 337 for trunk/kernel/vfs
- Timestamp:
- Aug 7, 2017, 12:50:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/vfs/vfs.c
r333 r337 40 40 #include <mapper.h> 41 41 #include <thread.h> 42 #include <chdev.h> 42 43 #include <process.h> 43 44 #include <vfs.h> … … 52 53 ////////////////////////////////////////////////////////////////////////////////////////// 53 54 54 extern vfs_ctx_t fs_context[FS_TYPES_NR]; // allocated in kernel_init.c 55 55 extern vfs_ctx_t fs_context[FS_TYPES_NR]; // allocated in kernel_init.c 56 57 extern chdev_directory_t chdev_dir; // allocated in kernel_init.c 56 58 57 59 ////////////////////////////////////////////////////////////////////////////////////////// … … 534 536 file->attr = attr; 535 537 file->offset = 0; 536 file->refcount = 0;538 file->refcount = 1; 537 539 file->inode = inode; 538 540 file->ctx = inode->ctx; … … 1053 1055 ////////////////////////////////////////////////////////////////////////// 1054 1056 // This static function is called by the vfs_display() function. 1057 // that is supposed to take the TXT0 lock. 1055 1058 ////////////////////////////////////////////////////////////////////////// 1056 1059 static void vfs_recursive_display( xptr_t inode_xp, … … 1104 1107 1105 1108 // display inode 1106 printk("%s%s <%s> inode_xp = %l / dentry_xp = %l\n",1107 indent_str[indent], vfs_inode_type_str( inode_type ),1108 name , inode_xp , dentry_xp );1109 nolock_printk("%s%s <%s> inode_xp = %l / dentry_xp = %l\n", 1110 indent_str[indent], vfs_inode_type_str( inode_type ), 1111 name , inode_xp , dentry_xp ); 1109 1112 1110 1113 // scan directory entries … … 1155 1158 cxy_t dentry_cxy; 1156 1159 vfs_dentry_t * dentry_ptr; 1160 uint32_t save_sr; 1157 1161 1158 1162 // get target inode cluster and local pointer … … 1179 1183 } 1180 1184 1185 // get pointers on TXT0 chdev 1186 xptr_t txt0_xp = chdev_dir.txt[0]; 1187 cxy_t txt0_cxy = GET_CXY( txt0_xp ); 1188 chdev_t * txt0_ptr = GET_PTR( txt0_xp ); 1189 1190 // get extended pointer on remote TXT0 chdev lock 1191 xptr_t lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock ); 1192 1193 // get TXT0 lock in busy waiting mode 1194 remote_spinlock_lock_busy( lock_xp , &save_sr ); 1195 1181 1196 // print header 1182 printk("\n*** VFS ***\n");1197 nolock_printk("\n***** file system state\n"); 1183 1198 1184 1199 // call recursive function 1185 1200 vfs_recursive_display( inode_xp , name_xp , dentry_xp , 0 ); 1201 1202 // release lock 1203 remote_spinlock_unlock_busy( lock_xp , save_sr ); 1186 1204 1187 1205 } // end vfs_display()
Note: See TracChangeset
for help on using the changeset viewer.