Hi!
> -static int tbio_open(struct inode *inode, struct file *filep)
> +static int tbio_open(struct block_device *blk, fmode_t mode)
> {
> - if (!Device.bdev) {
> - Device.bdev = inode->i_bdev;
> - //atomic_inc((atomic_t)&Device.bdev->bd_part_count);
> - }
> -
> return 0;
> }
>
> -static int tbio_release(struct inode *inode, struct file *filep)
> +static int tbio_release(struct gendisk *gd, fmode_t mode)
This function is declared as void since db2a144bedd58b3dcf19950c2f476c58c9f39d18
I guess that we should fix this by adding ifdefs for kernel versions
around the function declaration and around the return.
The rest of the code looks good to me.
Apart from that I'm wondering if it would be a good idea to add read()
and write() tests to the userspace program as well. Something as writing
to the device, issuing fsync() and checking that the request made it to
the block device driver once we have returned from it... But that can be
done in subsequent patches.
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list