Re: aio_read() in character driver is not getting calls when making aio_read system call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



file_operations structure contains aio_read and aio_write function pointers.
You may be refering to some old sources.
check at latest 2.6.18 sources.
 
Additionally, when I comment the .read = dbg_read function, it comes to my dbg_aio_read().
Which is working also.
 
Somewhere I read about O_DIRECT flag to pass when open a device.
Actually, for character device files, it default diverts requests to the syncronous read if O_DIRECT flag is not passed.
 
it is defined in fcntl.h file with __USE_GNU flag.
But I am keep on getting compilation error when I pass O_DIRECT flag.
 
Any idea, how can I remove this O_DIRECT undefined error?
 
Regards,
Parav Pandit
 


Rajath N R <rajathnr@xxxxxxxxx> wrote:
Hi Parav Pandit,

     I don`t think file_operations structure contain aio_read variable. If any thing wrong please let me know.
 

struct file_operations {
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
int (*readdir) (struct file *, void *, filldir_t);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
int (*mmap) (struct file *, struct vm_area_struct *);
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *);
int (*fasync) (int, struct file *, int);
int (*check_media_change) (kdev_t dev);
int (*revalidate) (kdev_t dev);
int (*lock) (struct file *, int, struct file_lock *);
};

Regards,
Rajath.N.R

On 12/8/06, Parav Pandit <paravpandit@xxxxxxxxx> wrote:
Hi,
 
I am adding aio_read and aio_write hooks to my character driver.
 
When I make aio_read() system call, for some reason instead of dbg_aio_read(), kernel is calling the syncronous dbg_read() function.
 
Here is the application level code for opening the file:
 
fd = open("/dev/debug_driver", O_RDONLY );
 
Below is the file_operations structure:
static struct file_operations debug_fops = {
.owner = THIS_MODULE,
.aio_read = dbg_aio_read,
.read = dbg_read,
.ioctl = dbg_ioctl,
.open = dbg_open,
.release = dbg_release,
};
 
What additional thing I need to do so that my char driver aio_read is called when application calls aio_read() system call?
Interestingly same code is working if i open a normal text file.
 
Regards,
Parav Pandit
 

Access over 1 million songs - Yahoo! Music Unlimited.



Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux