Search Results

Search found 3 results on 1 pages for 'coderanger'.

Page 1/1 | 1 

  • Linux Kernel - Red/Black Trees

    - by CodeRanger
    I'm trying to implement a red/black tree in Linux per task_struct using code from linux/rbtree.h. I can get a red/black tree inserting properly in a standalone space in the kernel such as a module but when I try to get the same code to function with the rb_root declared in either task_struct or task_struct-files_struct, I get a SEGFAULT everytime I try an insert. Here's some code: In task_struct I create a rb_root struct for my tree (not a pointer). In init_task.h, macro INIT_TASK(tsk), I set this equal to RB_ROOT. To do an insert, I use this code: rb_insert(&(current-fd_tree), &rbnode); This is where the issue occurs. My insert command is the standard insert that is documented in all RBTree documentation for the kernel: int my_insert(struct rb_root *root, struct mytype *data) { struct rb_node **new = &(root->rb_node), *parent = NULL; /* Figure out where to put new node */ while (*new) { struct mytype *this = container_of(*new, struct mytype, node); int result = strcmp(data->keystring, this->keystring); parent = *new; if (result < 0) new = &((*new)->rb_left); else if (result > 0) new = &((*new)->rb_right); else return FALSE; } /* Add new node and rebalance tree. */ rb_link_node(&data->node, parent, new); rb_insert_color(&data->node, root); return TRUE; } Is there something I'm missing? Some reason this would work fine if I made a tree root outside of task_struct? If I make rb_root inside of a module this insert works fine. But once I put the actual tree root in the task_struct or even in the task_struct-files_struct, I get a SEGFAULT. Can a root node not be added in these structs? Any tips are greatly appreciated. I've tried nearly everything I can think of.

    Read the article

  • Linux Kernel - traverse to buffer heads

    - by CodeRanger
    In the Linux kernel, is there a way to traverse down to the buffer_heads from within a module? I can see how to get to struct bio (task_struct macro: current-bio). But how can I get to the buffer heads? The buffer_head struct holds some information I'd like to obtain at any point regarding physical block numbers.

    Read the article

  • What would be the level of effort required to implement a screencapture command on a PS3 game?

    - by Sean Scott
    Looking to see what the level of effort is for implementing a screen capture command into PS3 game by a mid-level PS3 game developer. Bonus for a description of what is involved in the process... EDIT Not sure how to get back my question since it was the first but let me clarify some things. @Nate Bross, nope I am not the actor although i've fielded calls for him on occasion @coderanger my intent was to try and speak to other PS3 developers, however coming from a web development no one in my social circle close or extended develops on the PS3. Additionally i'm interested in hearing the effort required in terms of hours so that this information can be passed on to a client. A client who has a game on the PS3 using the unreal engine. Convo with devs sometimes go something like "can you implement feature a" which gets a response "this will take us 8 weeks and an army". Trying to be educated before the ask. I hope that helps If anyone here is a PS3 game dev and would like to respond off site so as not to break NDA that would be awesome. @Roger it would be from within the game, something that users can use. Something akin to the iphone screencap utility. No need to get fancier than that.

    Read the article

1