View of xos/fs/vfat_lock_struct.h


XOS | Parent Directory | View | Download

/* Copyright (C) 2008  Emmanuel Varoquaux
 
   This file is part of XOS.
 
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
 
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
#ifndef VFAT_LOCK_STRUCT_H
#define VFAT_LOCK_STRUCT_H
 
#include <rw_lock_struct.h>
 
enum {lr_read, lr_write};
 
struct vfat_lock_struct {
  unsigned int count;
  unsigned long id;
  int request;
  struct rw_lock_struct rw_lock;
};
 
struct vfat_lock_pool_struct {
  struct vfat_lock_struct *lock_table;
  unsigned int lock_table_size;
  struct vfat_lock_struct *free;
  struct condition_struct free_condition;
};
 
#endif