kiovec

From: pramodh mallipatna (pramodh@ittc.ukans.edu)
Date: Fri Feb 11 2000 - 14:05:24 EST

  • Next message: Horst von Brand: "2.3.43: IDE CD mount(8) hangs; ditto SysRq"

    Hello:

    I looked at the implementation of kiovec (map_user_kiobuf() routine).
    I understood how to get the 'struct page *' for the user buffer.

    What I want to know is,

       If I want to print the contents of the user buffer (in the kernel)
       using this 'struct page *' how do I do it ('struct page *' points
       to the physical page right)?

    I want to use kiovec for my driver, but I do not want to use the same
    interface, but something similar to it.

    Thanks,
    Pramodh

    I have the relevant code here. Please comment on this.

    This is what I have done in the code similar to map_user_kiobuf(). I have
    cut n pasted the relevant code only.

    my_user_buf_map_routine(unsigned long addr) /* user addr */
    {
            int offset;
            unsigned long ptr;
            struct vm_area_struct *vma;
            struct page *map;
            unsigned long buf;
            char *page_buffer;
            
            offset = addr & PAGE_MASK;
            ptr = addr & PAGE_MASK;

            vma = find_vma(current->mm, ptr);
            handle_mm_fault(current, vma, ptr, (rw==READ));
            map = follow_page(ptr);
            buf = page_address(map);
            page_buffer = (char *) (buf + offset);
            
            /* If i try to print the page_buffer it seg_faults
               but I get a valid pointer to the map (struct page *)
             */
    }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Fri Feb 11 2000 - 23:41:41 EST