noqset=size/(qsetsize*quantumsize);//if it has 126 characters ...size of file/8*8=126/8*8=2
98 //so i need 2 scullqset to write data bcz each scullqset has array of pointers(4byte)pointing to the memory of quantums....one of each array of 8 pointers will point to single quantum of 8 byt es so 8 characters could be written in each quantum after making 8 quantums at diffrent memory of linklist ...64 bytes could be write in first scullqset ..scullqset=scullqset->next is made ..now a gain next scullqset will have array of pointers pointing to each quantum each capable of writing 6 4 byte ...again next scullqset ...so on...in this way data could be write into a memory called scu lldev which is virtually supposed as a device this time....
101 noqset++;//if there is remainder left...it will represent left n. of characters that has t o be write at last...so one more quantum should be required ..
102 }
103 lsculldev->scullqset=lscullqset=create_scullqset(noqset);//scullqset are being created
104 if(!lsculldev->scullqset)
105 {
106 printk(KERN_INFO"mem not returnd for create_scullqset\n");
132 ret=copy_from_user(lscullqset->data[i],buffer+nocsw,noctw);//copy data into each quantum turn by t urn & increment the pointer so that next data may be written ..not same data frm starting
133 printk(KERN_INFO"ret=%d\n",ret);
134 printk(KERN_INFO"HIIIIIIIbuffer=====%s\n",buffer+nocsw);//print data written in quantums ..io may p rint whole data bcz it could not get null...so issue of that
135 nocsw=nocsw+(noctw);//cal. no. of characters succesfully written
136 noctw=size-(nocsw-ret);//cal. no. of characters to write
137 printk(KERN_INFO"noctw=%d\n",noctw);
138 }
139 if(i==7 && lscullqset->next)//array of pointers pointing 0 to 7 quantums ..now scullqset is to be changed
int create_qset(struct Scullqset *lscullqset,int noqset)
25 {
26 int lv;
27 for(lv=0;lv<noqset;lv++)//scullqset->data & scullqset->next ...data contains array of pointers..vo id** data represents pointer to a pointer which is holding quantum address..