Return-Path: william@bourbon.usc.edu Delivery-Date: Tue Nov 11 08:26:10 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mABGQ9AX021609 for ; Tue, 11 Nov 2008 08:26:09 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mABGLMGK000743 for ; Tue, 11 Nov 2008 08:21:22 -0800 Message-Id: <200811111621.mABGLMGK000743@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CS551: Final Project 2 : Permanent Size Date: Tue, 11 Nov 2008 08:21:22 -0800 From: Bill Cheng Someone wrote: > When storing the file, we have to check if the permanent storage has space > sufficient enough to store the file or not, but the PermSize key is > obsolete. So how do we get the size of permanent storage ? It's difficult to do, especially when disk quota is enforced. > Do we have to use start on our HomeDir to get this size ? or is there any > other way we need to handle this ? It's actually quite easy. When you write to the filesystem and when you close the file you were writing to, you must check the return code! If write() or close() is not successful, you need to take appropriate action. If you are interacting with the user, you need to tell the user. You should probably also log the condition into the logfile so you know what has failed. > Also, can you provide some details as to what does cache mean over here ? If you decide to keep a file in HomeDir/files, if it's not in the permanent space, then it's "cached". If this doesn't make sense, please ask me a more specific question. > caching will also be in a way saving the file in the directory then how do > we differ the permanent storage and cache ? If a file is not stored in the perm space, then it goes into the cache space. Slide 16 of lecture 18 says: If a node *initiates* a GET or a STORE, the file goes into its permanent space. So, if you decide to keep a file for another other reason than the one stated above, you should keep it in the cache space. -- Bill Cheng // bill.cheng@usc.edu