diff options
author | Anand Avati <avati@gluster.com> | 2010-06-07 12:37:34 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-06-07 11:58:50 -0700 |
commit | 79241696fbdebe2583298f12cbaee068ce60c655 (patch) | |
tree | 42e60d351e328fa34f17242c6c3359a8c01e8fa3 /libglusterfs/src/fd.h | |
parent | c4ebd25a176d6d51d702b1009e261c3c27237a48 (diff) |
dynamic volume changes for graph replacement
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 971 (dynamic volume management)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
Diffstat (limited to 'libglusterfs/src/fd.h')
-rw-r--r-- | libglusterfs/src/fd.h | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/libglusterfs/src/fd.h b/libglusterfs/src/fd.h index 9c5ebd8d..c2181d8a 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 */ |