Skip to content

Instantly share code, notes, and snippets.

@ctdk
Created April 22, 2013 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctdk/5437849 to your computer and use it in GitHub Desktop.
Save ctdk/5437849 to your computer and use it in GitHub Desktop.
int xiafs_rename(struct inode * old_dir, const char * old_name, int old_len,
struct inode * new_dir, const char * new_name, int new_len,
int must_be_dir)
{
/* TODO: Come back and fix race condition stuff */
static struct wait_queue_head_t * wait = NULL;
static int lock = 0;
int result;
while (lock)
sleep_on(wait);
lock = 1;
result = do_xiafs_rename(old_dir, old_name, old_len,
new_dir, new_name, new_len,
must_be_dir);
lock = 0;
wake_up(wait);
return result;
}
------
CC [M] /home/jeremy/linux-dev/xiafs/xiafs-module/namei.o
/home/jeremy/linux-dev/xiafs/xiafs-module/namei.c: In function ‘xiafs_rename’:
/home/jeremy/linux-dev/xiafs/xiafs-module/namei.c:846: warning: passing argument 1 of ‘sleep_on’ from incompatible pointer type
include/linux/wait.h:430: note: expected ‘struct wait_queue_head_t *’ but argument is of type ‘struct wait_queue_head_t *’
/home/jeremy/linux-dev/xiafs/xiafs-module/namei.c:852: warning: passing argument 1 of ‘__wake_up’ from incompatible pointer type
include/linux/wait.h:142: note: expected ‘struct wait_queue_head_t *’ but argument is of type ‘struct wait_queue_head_t *’
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment