Changeset 657 for trunk/kernel/kern/process.h
- Timestamp:
- Mar 18, 2020, 11:16:59 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.h
r651 r657 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 5 * Mohamed Lamine Karaoui (2015) 6 * Alain Greiner (2016,2017,2018,2019 )6 * Alain Greiner (2016,2017,2018,2019,2020) 7 7 * 8 8 * Copyright (c) UPMC Sorbonne Universites … … 70 70 /********************************************************************************************* 71 71 * This structure defines an array of extended pointers on the open file descriptors 72 * for a given process. We use an extended pointer because the open file descriptor 73 * isalways stored in the same cluster as the inode associated to the file.72 * for a given process. We use an extended pointer because the open file descriptors 73 * are always stored in the same cluster as the inode associated to the file. 74 74 * A free entry in this array contains the XPTR_NULL value. 75 75 * The array size is defined by the CONFIG_PROCESS_FILE_MAX_NR parameter. … … 79 79 * - the fd_array[] in a process copy is simply a cache containing a subset of the 80 80 * open files to speed the fdid to xptr translation, but the "lock" and "current 81 * fields are not used. 82 * - all modifications made by the process_fd_remove() are done in reference cluster 83 * and reported in all process_copies. 81 * fields are not significant for these copies. 82 * - the modifications made by the process_fd_remove() function are done in the 83 * reference cluster in all process_copies. 84 * - The modifications made by the process_fd_register() function are done in the 85 * reference cluster, and in the cluster containing the calling thread. 84 86 ********************************************************************************************/ 85 87 … … 436 438 437 439 /********************************************************************************************* 438 * This function allocates a free slot in the fd_array of the reference process 440 * This function allocates a free slot in the fd_array of the reference process descriptor 439 441 * identified by the <process_xp> argument, register the <file_xp> argument in the 440 442 * allocated slot, and return the slot index in the <fdid> buffer. 441 * It can be called by any thread in any cluster, because it uses remote access442 * primitives to access the reference process descriptor.443 * Note: we must use the reference process descriptor, because the reference fd_array is 444 * contained in the reference cluster. It can be called by any thread in any cluster. 443 445 * It takes the lock protecting the reference fd_array against concurrent accesses. 444 446 ********************************************************************************************* … … 454 456 /********************************************************************************************* 455 457 * This function uses as many remote accesses as required, to reset an entry in fd_array[], 456 * in all clusters containing a copy. The entry is identified by the <fdid> argument. 457 * This function must be executed by a thread running in reference cluster, that contains 458 * the complete list of process descriptors copies. 458 * identified by the <fdid> argument, in all clusters containing a copy of the 459 * process descriptor, identified by the <process_xp> argument. 460 * Note: we must use the owner process descriptor, because only this owner cluster contains 461 * the list of process copies. It can be called by any thread in any cluster. 459 462 * It takes the lock protecting the reference fd_array against concurrent accesses. 460 * TODO this function is not implemented yet.461 463 ********************************************************************************************* 462 464 * @ process : [in] pointer on the local process descriptor. 463 465 * @ fdid : [in] file descriptor index in the fd_array. 464 466 ********************************************************************************************/ 465 void process_fd_remove( process_t * process,466 uint32_t 467 void process_fd_remove( xptr_t process_xp, 468 uint32_t fdid ); 467 469 468 470 /*********************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.