0
$\begingroup$

Assume that a file is written using write(fd, buf, K) system calls, where fd is the file descriptor, and K, the number of files to be written to the current file offset which is a multiple of the disk block size D. The total number of disk block writes required to be executed before the system call returns is:

(a) is equal to K/D

(b) is less than K/D

(c) is greater than K/D

(d) None of the above.

In my opinion, the answer should be (c). But the solution manual says it's (d).

I believe the number of file writes required for writing a file is $ceil(K/D)$ So, the answer should be (c).

Am I correct? If not, what am I doing wrong?

Thanks in advance!

$\endgroup$
  • 1
    $\begingroup$ Think about it this way. Is any of the others always true? Is ceil(K/D) always greater than K/D, or always equal to it? $\endgroup$ – Draconis Jan 7 at 3:13
1
$\begingroup$

The correct answer is: greater or equal to K/D, depending on the fact that K can be a multiple of D or not. So, the answer is actually c), which differs from the other three answers.

Note that if there were an answer “ceil(K/D)”, that would have been the correct answer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.