LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2014, 08:47 AM   #1
vinayak099
Member
 
Registered: Jan 2014
Posts: 31

Rep: Reputation: Disabled
need information on Address space operation


Hi,

actually I am going through ecryptfs code in which
they are using address_space_operations and they are gettig called whenever I write a file or read a file.

my queries are

1. I am not able to understand who is triggering those.

2. actually field .write = do_sync_write; and .read = do_synd_read in struct file_operations. so call should be delagated to do_sync_write and do_sync_read whenever I do write and read call. but address space operations are getting called.

code part :
const struct file_operations ecryptfs_main_fops = {
.llseek = generic_file_llseek,
.read = do_sync_read,
.aio_read = ecryptfs_read_update_atime,
.write = do_sync_write,
--
}

3. Is call to address space operations happening from do_sync_write and do_sync_read from read_write.c ?

code part from read_write.c
ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos)
{
--
--
ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos);

--
}

4. basically what function will be called when I do
filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos);

I searched for it but did not get where the function pointer is assigned

Can anybody please expalin me the flow or guide me little.

its for your reference.

--------------------------------------------------------

const struct address_space_operations ecryptfs_aops = {
.writepage = ecryptfs_writepage,
.readpage = ecryptfs_readpage,
.write_begin = ecryptfs_write_begin,
.write_end = ecryptfs_write_end,
.bmap = ecryptfs_bmap,
};

and during mount they set the inode with these operations

static int ecryptfs_inode_set(struct inode *inode, void *opaque)
{
--- (some other code)

inode->i_mapping->a_ops = &ecryptfs_aops;

---
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shared memory address area in process address space nagaraju1024 Programming 3 02-22-2011 04:49 AM
[SOLVED] No space on root after large move operation ulver Linux - Newbie 1 02-16-2010 06:05 AM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Security 1 09-15-2009 12:56 AM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 1 09-14-2009 08:31 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 0 09-14-2009 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration