Skip to content

Commit

Permalink
notes on aio and quota added to doc dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Puri committed Oct 21, 2010
1 parent ef4e71d commit 3fae8b6
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
61 changes: 61 additions & 0 deletions doc/aio.org
@@ -0,0 +1,61 @@

1. in file_operations there are vops to be implemented

1) aio_read
2) aio_write
3) aio_fsync


aio_read : - (struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)

aio_write : - (struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)

They initiate the read or write operation which may or may not complete by the
time they return.

kiocb stands for kernel I/O control blocks


Thinks to take into account

1. pos is passed by value ( as async ops never change file pos ).
2. kernel can on occasion create synchronous iocbs they are async ios that must be executed synchronously.


System call interfaces behaviour : -

A synchronous write operation does not return until the written data is -> atleast stored in the kernels buffer cache.

A synchronous read operation does not return until the read data is stored in the user-space buffer.
i
Their async counter parts may only be queued for later.


Synchronized/Blocking operation is more restrictive and safer than merely synchronous operation.


A synchronized write flushes the data to disk, ensuring that the on-disk data is always in sync with the corr kernel buffers. O_SYNC

A synchronized read operation always returns the most up-to-date copy of data, from the disk.

Read operations are always synchronized, as reading stale data is of no use.


Asynchronous read operation return as soon as the request is queued, but when the read operation executes the data returned is up-to-date.















23 changes: 23 additions & 0 deletions doc/quota.org
@@ -0,0 +1,23 @@

Quota allows one to specify limits for two aspects of disk storage:

1. no of inodes a user or a group of users may possess
2. no.of disk blocks that may be allocated to a user or a group of users.

handled per user, per filesystem basis.


Quota code flow in zfs : - ( zfs set userquota, groupquota )

In zfs_main.c function -> zfs_do_set -> zfs_for_each which has a second last para as callback function -> set_callback

-> zfs_prop_set which invokes the zfs_ioctl with ZFS_IOC_SET_PROP which calls the zfs_ioc_set_prop in the kernel


which calls zfs_set_prop_nvlist this function inside

which checks at the middle abt the zfs property of userquota and that code is commented.




0 comments on commit 3fae8b6

Please sign in to comment.