<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 20, 2016, at 2:25 PM, Ruben Safir <<a href="mailto:ruben@mrbrklyn.com" class="">ruben@mrbrklyn.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Sun, Mar 20, 2016 at 01:58:47PM +0800, 张云 wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Thanks!<br class="">I have another question if it is possible to rewrite the data transfer function avoiding the bio complexity?<span class="Apple-converted-space"> </span><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">what is the bio complexity that you are refering to?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>I don’t think request’s bio is much complex.</div><div>I want to rewrite the data transfer function as simple as possible </div><div>for getting my driver working even without the knowledges of bio, like the sbull_request.</div><br class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">Yun Zhang(张云)<br class=""><br class=""><blockquote type="cite" class="">On Mar 20, 2016, at 8:13 AM, Dongli Zhang <<a href="mailto:dongli.zhang0129@hotmail.com" class="">dongli.zhang0129@hotmail.com</a>> wrote:<br class=""><br class="">Please refer to <a href="https://github.com/21cnbao/training/tree/50506cf04bc5616e0c3f3285dbb006c54deb1c53/kernel/drivers/vmem_disk" class="">https://github.com/21cnbao/training/tree/50506cf04bc5616e0c3f3285dbb006c54deb1c53/kernel/drivers/vmem_disk</a><br class=""><br class="">Dongli Zhang (张东立)<br class=""><a href="http://finallyjustice.github.io" class="">http://finallyjustice.github.io</a><br class=""><br class=""><br class="">________________________________<br class=""><blockquote type="cite" class="">From: zyunone@163.com<span class="Apple-converted-space"> </span><br class="">Subject: How to rewrite sbull_request in ldd3 for current kernel?<span class="Apple-converted-space"> </span><br class="">Date: Sat, 19 Mar 2016 21:22:19 +0800<span class="Apple-converted-space"> </span><br class="">To: kernelnewbies@kernelnewbies.org<span class="Apple-converted-space"> </span><br class=""><br class="">Hi,<span class="Apple-converted-space"> </span><br class="">I am reading the book, Linux Driver Development 3.<span class="Apple-converted-space"> </span><br class="">In the chapter on block driver of this book, I need some help to<span class="Apple-converted-space"> </span><br class="">rewriting the sbull_request since the kernel’s block API was changed.<span class="Apple-converted-space"> </span><br class=""><br class="">The sbull_request code:<span class="Apple-converted-space"> </span><br class="">/*<span class="Apple-converted-space"> </span><br class="">* The simple form of the request function.<span class="Apple-converted-space"> </span><br class="">*/<span class="Apple-converted-space"> </span><br class="">static void sbull_request(request_queue_t *q)<span class="Apple-converted-space"> </span><br class="">{<span class="Apple-converted-space"> </span><br class="">struct request *req;<span class="Apple-converted-space"> </span><br class=""><br class="">while ((req = elv_next_request(q)) != NULL) {<span class="Apple-converted-space"> </span><br class="">struct sbull_dev *dev = req->rq_disk->private_data;<span class="Apple-converted-space"> </span><br class="">if (! blk_fs_request(req)) {<span class="Apple-converted-space"> </span><br class="">printk (KERN_NOTICE "Skip non-fs request\n");<span class="Apple-converted-space"> </span><br class="">end_request(req, 0);<span class="Apple-converted-space"> </span><br class="">continue;<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class="">sbull_transfer(dev, req->sector, req->current_nr_sectors,<span class="Apple-converted-space"> </span><br class="">req->buffer, rq_data_dir(req));<span class="Apple-converted-space"> </span><br class="">end_request(req, 1);<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class=""><br class="">I have rewritten the code above into:<span class="Apple-converted-space"> </span><br class=""><br class="">/*<span class="Apple-converted-space"> </span><br class="">* The simple form of the request function.<span class="Apple-converted-space"> </span><br class="">*/<span class="Apple-converted-space"> </span><br class="">void blkplay_request(struct request_queue *q)<span class="Apple-converted-space"> </span><br class="">{<span class="Apple-converted-space"> </span><br class="">struct request *req;<span class="Apple-converted-space"> </span><br class=""><br class="">while (!blk_queue_stopped(q) &&<span class="Apple-converted-space"> </span><br class="">(req = blk_peek_request(q)) != NULL) {<span class="Apple-converted-space"> </span><br class="">struct blkplay_dev *dev = req->rq_disk->private_data;<span class="Apple-converted-space"> </span><br class="">blk_start_request(req);<span class="Apple-converted-space"> </span><br class="">if (req->cmd_type != REQ_TYPE_FS) {<span class="Apple-converted-space"> </span><br class="">printk (KERN_NOTICE "Skip non-fs request\n");<span class="Apple-converted-space"> </span><br class="">blk_end_request(req, -EIO, 0);<span class="Apple-converted-space"> </span><br class="">continue;<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class=""><br class="">/* I don’t know how to write the statement below */<span class="Apple-converted-space"> </span><br class="">blkplay_transfer(dev, req->sector, req->current_nr_sectors,<span class="Apple-converted-space"> </span><br class="">req->buffer, rq_data_dir(req));<span class="Apple-converted-space"> </span><br class=""><br class="">blk_end_request_cur(req, 0);<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class="">}<span class="Apple-converted-space"> </span><br class=""><br class=""><br class="">Is the rewrite proper?<span class="Apple-converted-space"> </span><br class=""><br class=""><br class=""><br class="">The compiler can’t compile it because the request struct no longer has<span class="Apple-converted-space"> </span><br class=""><br class="">the field of ‘sector’ and ‘current_nr_sectors’. I have read the kernel code<span class="Apple-converted-space"> </span><br class=""><br class="">about the request struct, the kernel code said the __data_len and<span class="Apple-converted-space"> </span><br class="">__sector field of<span class="Apple-converted-space"> </span><br class="">request struct is internal so that we shouldn’t access them directly.<span class="Apple-converted-space"> </span><br class=""><br class="">How could I rewrite it ? Thanks.<span class="Apple-converted-space"> </span><br class=""><br class="">_______________________________________________ Kernelnewbies mailing<span class="Apple-converted-space"> </span><br class="">list Kernelnewbies@kernelnewbies.org<span class="Apple-converted-space"> </span><br class="">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<span class="Apple-converted-space"> </span><br class=""></blockquote><span class="Apple-tab-span" style="white-space: pre;">        </span><span class="Apple-tab-span" style="white-space: pre;">        </span><span class="Apple-converted-space"> </span><span class="Apple-tab-span" style="white-space: pre;">        </span><span class="Apple-converted-space"> </span> <span class="Apple-tab-span" style="white-space: pre;">        </span><span class="Apple-tab-span" style="white-space: pre;">        </span><span class="Apple-converted-space"> </span> <br class="">_______________________________________________<br class="">Kernelnewbies mailing list<br class="">Kernelnewbies@kernelnewbies.org<br class="">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br class=""></blockquote><br class=""><br class=""><br class="">_______________________________________________<br class="">Kernelnewbies mailing list<br class=""><a href="mailto:Kernelnewbies@kernelnewbies.org" class="">Kernelnewbies@kernelnewbies.org</a><br class=""><a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" class="">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">So many immigrant groups have swept through our town</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">that Brooklyn, like Atlantis, reaches mythological</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">proportions in the mind of the world - RI Safir 1998</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://www.mrbrklyn.com/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://www.mrbrklyn.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://www.nylxs.com/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://www.nylxs.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>- Leadership Development in Free Software</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://www2.mrbrklyn.com/resources" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://www2.mrbrklyn.com/resources</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>- Unpublished Archive<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://www.coinhangout.com/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://www.coinhangout.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>- coins!</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://www.brooklyn-living.com/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://www.brooklyn-living.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Being so tracked is for FARM ANIMALS and and extermination camps,<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">but incompatible with living as a free human being. -RI Safir 2013</span></div></blockquote></div><br class=""></body></html>