/branches/fs/uspace/fs/inode.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This file manages the inode table. There are procedures to allocate and |
* deallocate inodes, acquire, erase, and release them, and read and write |
* them from the disk. |
/branches/fs/uspace/fs/super.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Superblock support. */ |
/* Methods: |
/branches/fs/uspace/fs/block.h |
---|
1,3 → 1,38 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Data block. */ |
#ifndef _BLOCK_H |
/branches/fs/uspace/fs/open.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This file contains the procedures for opening, closing, and seeking on files. */ |
/* Methods: |
/branches/fs/uspace/fs/inode.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Inode table. This table holds inodes that are currently in use. In some |
* cases they have been opened by an open() or creat() system call, in other |
* cases the file system itself needs the inode for one reason or another, |
/branches/fs/uspace/fs/super.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* |
* The s_ninodes field gives the number of inodes available |
* for files and directories, including the root directory. Inode 0 is |
/branches/fs/uspace/fs/utility.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This file contains a few general purpose utility routines. */ |
/* Methods: |
/branches/fs/uspace/fs/limits.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Constants which define limits of file system capabilities. */ |
#ifndef _LIMITS_H_ |
6,12 → 42,9 |
/* Number of slots in the process table for user processes. */ |
#define NR_PROCS 20 |
#define NAME_MAX 14 // #chars in file name |
#define NAME_MAX_EX 30 // #chars in file name - extended versions |
#define PATH_MAX 255 // #chars in path name |
#define OPEN_MAX 20 // open files a process may have |
#define NAME_MAX 14 /* #chars in file name */ |
#define NAME_MAX_EX 30 /* #chars in file name - extended versions */ |
#define PATH_MAX 255 /* #chars in path name */ |
#define OPEN_MAX 20 /* open files a process may have */ |
/* Maximum of messages that can be sent in phase of initiating of new consumer connection. */ |
#define COUNTER_MAX 5 |
#endif /* _LIMITS_H_ */ |
/branches/fs/uspace/fs/proto.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Function prototypes. */ |
/branches/fs/uspace/fs/filedes.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This file contains the procedures that manipulate file descriptors. */ |
/* |
/branches/fs/uspace/fs/read.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This file contains the heart of the mechanism used to read files. |
* Read requests are split up into chunks that do not cross block |
* boundaries. Each chunk is then processed in turn. |
/branches/fs/uspace/fs/fproc.h |
---|
1,3 → 1,38 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This is the per-process information. A slot is reserved for each potential |
* process. |
*/ |
/branches/fs/uspace/fs/stat.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Definition of a struct that is used in the stat and fstat calls. |
* The information in this struct comes from the i-node of some file. |
* These calls are the only approved way to inspect i-nodes. |
/branches/fs/uspace/fs/glo.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Global variables declaring. */ |
/branches/fs/uspace/fs/dir.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* The layout of a directory. */ |
/branches/fs/uspace/fs/file.h |
---|
1,3 → 1,38 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This is the filp table. It is an intermediary between file descriptors and |
* inodes. A slot is free if filp_count == 0. |
*/ |
/branches/fs/uspace/fs/glo.h |
---|
1,3 → 1,38 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Global variables */ |
/branches/fs/uspace/fs/stadir.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This file contains the code for performing four system calls relating to |
* status and directories. |
*/ |
85,10 → 121,10 |
if (fetch_name(file_name, strlen(file_name)+1) != OK) |
return err_code; |
if ((rip = eat_path(user_path)) == NIL_INODE) |
return err_code; |
r = stat_inode(rip, NIL_FILP, fp->buffer); /* actually do the work.*/ |
put_inode(rip); /* release the inode */ |
/branches/fs/uspace/fs/type.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Declaration of the basic used types which are part of the V1 and V2 inode |
* as it is on the disk (not in memory). |
*/ |
/branches/fs/uspace/fs/table.c |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* This file contains the table used to map system call numbers onto the |
* routines that perform them. |
*/ |
8,7 → 44,7 |
#include "inode.h" |
#include "super.h" |
int (*call_vector[FS_CALLS])(void) = { |
int (*call_vector[FS_CALLS])(void) = { |
no_sys, /* 0 = unused */ |
do_open, /* 1 = open */ |
do_lseek, /* 2 = seek */ |
/branches/fs/uspace/fs/const.h |
---|
1,3 → 1,39 |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Constants of all file system. Some of them are not used here in |
* current version, but will be used in later versions probably. |
*/ |
27,8 → 63,6 |
#define MAX(a, b) ((a) > (b) ? (a) : (b)) |
#define MIN(a, b) ((a) < (b) ? (a) : (b)) |
//#define FS_PROC_NR SERVICE_FS /* process number of file system */ |
#define I_NOT_ALLOC 0000000 /* this inode is free */ |
#define I_TYPE 0170000 /* this field gives inode type */ |
/branches/fs/uspace/fs/path.c |
---|
1,7 → 1,42 |
/* This file contains the procedures that look up path names in the directory |
* system and determine the inode number that goes with a given path name. |
*/ |
/* |
* Copyright (c) 1987,1997, Prentice Hall |
* All rights reserved. |
* |
* Redistribution and use of the MINIX operating system in source and |
* binary forms, with or without modification, are permitted provided |
* that the following conditions are met: |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above |
* copyright notice, this list of conditions and the following |
* disclaimer in the documentation and/or other materials provided |
* with the distribution. |
* - Neither the name of Prentice Hall nor the names of the software |
* authors or contributors may be used to endorse or promote |
* products derived from this software without specific prior |
* written permission. |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/* Methods: |
* eat_path: the 'main' routine of the path-to-inode conversion mechanism |
* last_dir: find the final directory on a given path |
41,19 → 76,20 |
if (sp->s_extend) { |
name_len = NAME_MAX_EX; |
} |
/* First open the path down to the final directory. */ |
if ( (ldip = last_dir(path, string, name_len)) == NIL_INODE) |
return NIL_INODE; /* we couldn't open final directory */ |
/* The path consisting only of "/" is a special case, check for it. */ |
if (string[0] == '\0') |
return ldip; |
/* Get final component of the path. */ |
rip = advance(ldip, string, name_len); |
put_inode(ldip); |
return rip; |
} |
88,6 → 124,7 |
/* Extract one component. */ |
if ( (new_name = get_name(path, string, string_length)) == (char*) 0) { |
put_inode(rip); /* bad path in user space */ |
return NIL_INODE; |
} |
if (*new_name == '\0') |
217,9 → 254,9 |
block_num_t b; |
/* If 'ldir_ptr' is not a pointer to a dir inode, error. */ |
if ((ldir_ptr->i_mode & I_TYPE) != I_DIRECTORY) |
if ((ldir_ptr->i_mode & I_TYPE) != I_DIRECTORY) { |
return FS_ENOTDIR; |
} |
r = OK; |
/* Step through the directory one block at a time. */ |
244,8 → 281,9 |
match = 1; |
} |
else { |
if (fs_strncmp(dp->d_name, string, NAME_MAX) == 0) |
if (fs_strncmp(dp->d_name, string, NAME_MAX) == 0) { |
match = 1; |
} |
} |
} |
280,9 → 318,9 |
block_num_t b; |
/* If 'ldir_ptr' is not a pointer to a dir inode, error. */ |
if ( (ldir_ptr->i_mode & I_TYPE) != I_DIRECTORY) |
if ( (ldir_ptr->i_mode & I_TYPE) != I_DIRECTORY) { |
return FS_ENOTDIR; |
} |
r = OK; |
/* Step through the directory one block at a time. */ |
306,8 → 344,10 |
strcmp(dp->d_name, "..") != 0) match = 1; |
} |
else { |
if (fs_strncmp(dp->d_name, string, NAME_MAX_EX) == 0) |
if (fs_strncmp(dp->d_name, string, NAME_MAX_EX) == 0) { |
match = 1; |
} |
} |
} |