09-17-2009
Quote:
Originally Posted by
Krothos
So once the bytes are transferred stored over in the main memory through the DMA, how is what was read returned to the caller? So if I wanted to read 3 bytes from a file containing "Hello", how is "Hel" returned to the library function? What sees this and how/where is it returned from?
That's the whole purpose of a system call. Passing data from/to the kernel.
Quote:
That was what I was saying. I don't get the process of how write takes place in terms of a file let's say.
That's the picture but the process is quite more complex than your description.
There are several layers crossed by the data between your application and the disk blocks.
As you are talking about a file, the filesystem, file cache and possibly a log are playing a role. Writes are usually delayed so you will need to wait for a flush for the data to be committed on disk. Also, some form of software or hardware raid (mirroring/striping and the likes), checksums or compression might take place, the disk itself will certainly have a cache too.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I got the freebsd kernel source from the first install CD(in directory:\7.0-RELEASE\src\),isn't right? if so,how can i read it? Is there any tools? (4 Replies)
Discussion started by: zhouq3132
4 Replies
2. Shell Programming and Scripting
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
3. UNIX for Dummies Questions & Answers
Ok, so I'm trying to finalize my understanding of read/write and kernel interaction.
read():
You have a library function that has as it's first parameter (what the open file to read from is), second parameter( a pointer to a buffer (is this the location of a buffer in the user area or the... (1 Reply)
Discussion started by: Krothos
1 Replies
4. IP Networking
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies
5. Solaris
Hi gurus
Could anybody tell me which file is read by kernel to set its default system kernal parameters values in solaris. Here I am not taking about /etc/system file which is used to load kernal modules or to change any default system kernal parameter value
Is it /dev/kmem file or something... (1 Reply)
Discussion started by: girish.batra
1 Replies
6. Shell Programming and Scripting
im in a basic unix class and our professor speaks broken engliash so i can never understand what exactly we are doing in class and i have no prior experience with unix. we were given an assignment to make 2 files. one to Input 10 numbers and print out the biggest number, and one to Write a script... (1 Reply)
Discussion started by: wendyshephard
1 Replies
7. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
make 2 files. one to Input 10 numbers and print out the biggest number, and one to Write a script that can check... (1 Reply)
Discussion started by: wendyshephard
1 Replies
8. Programming
Hi, im trying to lern about raw sockets with my debian and c++. Tried to make a icmp and tcp packet and send it with sendto. Checked on wireshark and recognized that kernel changed my headers. So searched about stopping the kernel change the header and tried it with setsockopt, like said in at this... (4 Replies)
Discussion started by: sandcastle
4 Replies
9. Programming
Hi,
I have started reading about Linux kernel. The books also explains about the source code here and there.
I found a file named head.s in the source which i am not able to understand, it looks like some assembly language.
Can anyone confirm this, so that can start looking for assemble... (3 Replies)
Discussion started by: kumaran_5555
3 Replies
10. Ubuntu
I'm a beginner to the Linux programming and trying my hands on some device driver examples while practising. The below code (a trimmed down version of tiny_tty.c from ldd3 book) loads perfectly using insmod and I'm able to see it in /proc/tty/drivers , /proc/modules and device nodes are getting... (1 Reply)
Discussion started by: diwsdiwa
1 Replies
LEARN ABOUT SUSE
vfs_cacheprime
VFS_CACHEPRIME(8) System Administration tools VFS_CACHEPRIME(8)
NAME
vfs_cacheprime - prime the kernel file data cache
SYNOPSIS
vfs objects = cacheprime
DESCRIPTION
This VFS module is part of the samba(7) suite.
The vfs_cacheprime VFS module reads chunks of file data near the range requested by clients in order to make sure the data is present in
the kernel file data cache at the time when it is actually requested by clients.
The size of the disk read operations performed by vfs_cacheprime is determined by the cacheprime:rsize option. All disk read operations are
aligned on boundaries that are a multiple of this size. Each range of the file data is primed at most once during the time the client has
the file open.
This module is stackable.
OPTIONS
cacheprime:rsize = BYTES
The number of bytes with which to prime the kernel data cache.
The following suffixes may be applied to BYTES:
o K - BYTES is a number of kilobytes
o M - BYTES is a number of megabytes
o G - BYTES is a number of gigabytes
EXAMPLES
For a hypothetical disk array, it is necessary to ensure that all read operations are of size 1 megabyte (1048576 bytes), and aligned on 1
megabyte boundaries:
[hypothetical]
vfs objects = cacheprime
cacheprime:rsize = 1M
CAVEATS
cacheprime is not a a substitute for a general-purpose readahead mechanism. It is intended for use only in very specific environments where
disk operations must be aligned and sized to known values (as much as that is possible).
VERSION
This man page is correct for version 3.0.25 of the Samba suite.
AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open
Source project similar to the way the Linux kernel is developed.
Samba 3.5 06/18/2010 VFS_CACHEPRIME(8)