Changeset 612 for trunk/kernel/syscalls/sys_opendir.c
- Timestamp:
- Jan 11, 2019, 6:35:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_opendir.c
r611 r612 1 1 /* 2 * sys_opendir.c - Open a VFS directory.2 * sys_opendir.c - Open an user accessible VFS directory. 3 3 * 4 4 * Author Alain Greiner (2016,2017,2018) … … 27 27 #include <thread.h> 28 28 #include <process.h> 29 #include < remote_dir.h>29 #include <user_dir.h> 30 30 #include <printk.h> 31 31 #include <errno.h> … … 45 45 cxy_t inode_cxy; // directory inode cluster 46 46 uint32_t inode_type; // to check directory inode type 47 xptr_t dir_xp; // extended pointer on remote_dir_t 48 remote_dir_t * dir_ptr; // local pointer on remote_dir_t 49 cxy_t dir_cxy; // remote_dir_t cluster identifier 47 user_dir_t * dir_ptr; // local pointer on user_dir_t 50 48 vseg_t * vseg; // for user space checking 51 49 intptr_t ident; // dirent array pointer in user space … … 145 143 } 146 144 147 // allocate, initialize, and register a new remote_dir_t structure 148 // in the calling process reference cluster 149 dir_xp = remote_dir_create( inode_xp ); 150 dir_ptr = GET_PTR( dir_xp ); 151 dir_cxy = GET_CXY( dir_xp ); 145 // create a new user_dir_t structure in inode cluster 146 // and get the user space pointer on dirent array 147 if( inode_cxy == local_cxy ) 148 { 149 dir_ptr = user_dir_create( inode_ptr ); 150 } 151 else 152 { 153 rpc_user_dir_create_client( inode_cxy, 154 inode_ptr, 155 &dir_ptr ); 156 } 152 157 153 if( dir_ xp == XPTR_NULL )158 if( dir_ptr == NULL ) 154 159 { 155 160 156 161 #if DEBUG_SYSCALLS_ERROR 157 printk("\n[ERROR] in %s / thread[%x,%x] : cannot create remote_dir for <%s>\n",162 printk("\n[ERROR] in %s / thread[%x,%x] : cannot create user_dir for <%s>\n", 158 163 __FUNCTION__ , process->pid , this->trdid , kbuf ); 159 164 #endif … … 162 167 } 163 168 164 // get ident from remote_dir structure165 ident = (intptr_t)hal_remote_lpt( XPTR( dir_cxy , &dir_ptr->ident ) );169 // get ident from user_dir structure 170 ident = (intptr_t)hal_remote_lpt( XPTR( inode_cxy , &dir_ptr->ident ) ); 166 171 167 172 // set ident value in user buffer
Note: See TracChangeset
for help on using the changeset viewer.