Topic : TOS - The Operating System Author : Version : tos.hyp (December 19, 2008) Subject : Programmieren/Atari Nodes : 3010 Index Size : 93790 HCP-Version : 5 Compiled on : Atari @charset : atarist @lang : @default : Title @help : @options : +g -i -s +x +zz -t4 @width : 70 View Ref-File11.5.16.9 xfs_ddelete TOS Name: »xfs_ddelete« - Delete a directory. Parameters: a0 = DD * -> d0 = long errcode Description: The call xfs_ddelete had to be altered as of MagiC Version 4.01. For MagiC < 4.01 (kernel version < 3) the following applies: During deletion one must ensure that no directory may be referenced by the kernel except by the call itself (i.e. dd_refcnt must == 1). In addition one must ensure that there are no files in the directory. ELINK may not be returned, symbolic links may not be processed. The access rights (if they exist) must be tested by the XFS. For MagiC < 4.01 (kernel version >= 3) the following applies: Reentrance problems gave rise to some changes, whereby the kernel takes over access control from the XFS and furthermore the kernel releases the DD, not the XFS: The kernel first of all opens the parent of the directory to be deleted with xfs_path2DD, then it tests with xfs_xattr whether it is dealing with a symlink, and if appropriate deletes it with xfs_fdelete. If it is dealing with a directory, the kernel opens this again with xfs_path2DD (mode 1) and releases the parent again with xfs_freeDD. The check of dd_refcnt is performed by the kernel, hence the counter can and must be ignored by the XFS. The XFS must now ensure that the directory to be deleted or the DD cannot be opened or used by others (important for reentrant XFSs). The XFS then deletes the directory, but does not (!) release the DD, so that the kernel if successful (return value E_OK) can release its standard paths beforehand. The kernel then calls xfs_freeDD. As usual the XFS must check that the directory is empty, or if access rights exist if appropriate. Again in context: . The kernel ascertains the DD to be deleted, tests the reference counter . xfs_ddelete locks the DD. If this does not work then EACCDN is returned . xfs_ddelete deletes the directory, provided it is empty; here the DD acts as a lock for parallel- runnning attempts to use the newly deleted directory . xfs_ddelete leaves the now invalid (but still serving as a lock) DD still valid (in contrast to the old concept) . On success the kernel makes its standard paths invalid . The kernel releases the DD Group: Make-up of an XFS See also: MagiC's XFS-concept Ddelete