From 79241696fbdebe2583298f12cbaee068ce60c655 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 7 Jun 2010 12:37:34 +0000 Subject: dynamic volume changes for graph replacement Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971 --- libglusterfs/src/fd.h | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'libglusterfs/src/fd.h') diff --git a/libglusterfs/src/fd.h b/libglusterfs/src/fd.h index 9c5ebd8d786..c2181d8af17 100644 --- a/libglusterfs/src/fd.h +++ b/libglusterfs/src/fd.h @@ -33,9 +33,10 @@ struct _inode; struct _dict; + struct _fd_ctx { - uint64_t key; - uint64_t value; + uint64_t key; + uint64_t value; }; /* If this structure changes, please have mercy on the booster maintainer @@ -55,12 +56,14 @@ struct _fd { }; typedef struct _fd fd_t; + struct fd_table_entry { fd_t *fd; int next_free; }; typedef struct fd_table_entry fdentry_t; + struct _fdtable { int refcount; uint32_t max_fds; @@ -70,6 +73,7 @@ struct _fdtable { }; typedef struct _fdtable fdtable_t; + /* Signifies no more entries in the fd table. */ #define GF_FDTABLE_END -1 @@ -81,58 +85,77 @@ typedef struct _fdtable fdtable_t; #include "logging.h" #include "xlator.h" -inline void + +inline void gf_fd_put (fdtable_t *fdtable, int32_t fd); + fd_t * gf_fd_fdptr_get (fdtable_t *fdtable, int64_t fd); + fdtable_t * gf_fd_fdtable_alloc (void); -int32_t + +int gf_fd_unused_get (fdtable_t *fdtable, fd_t *fdptr); + fdentry_t * gf_fd_fdtable_get_all_fds (fdtable_t *fdtable, uint32_t *count); -void + +void gf_fd_fdtable_destroy (fdtable_t *fdtable); + fd_t * fd_ref (fd_t *fd); + void fd_unref (fd_t *fd); + fd_t * fd_create (struct _inode *inode, pid_t pid); + fd_t * fd_lookup (struct _inode *inode, pid_t pid); + uint8_t fd_list_empty (struct _inode *inode); + fd_t * fd_bind (fd_t *fd); + int fd_ctx_set (fd_t *fd, xlator_t *xlator, uint64_t value); -int + +int fd_ctx_get (fd_t *fd, xlator_t *xlator, uint64_t *value); -int + +int fd_ctx_del (fd_t *fd, xlator_t *xlator, uint64_t *value); + int __fd_ctx_set (fd_t *fd, xlator_t *xlator, uint64_t value); -int + +int __fd_ctx_get (fd_t *fd, xlator_t *xlator, uint64_t *value); -int + +int __fd_ctx_del (fd_t *fd, xlator_t *xlator, uint64_t *value); + #endif /* _FD_H */ -- cgit