From 01a48790c4a0c9805eb55bfe1c60860ee91f48a1 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 16 Apr 2009 23:54:58 -0700 Subject: libglusterfsclient: Add closedir API Signed-off-by: Anand V. Avati --- libglusterfsclient/src/libglusterfsclient.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libglusterfsclient') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index de9eed55f..ea4998f12 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -3593,6 +3593,28 @@ out: return dirfd; } +int +glusterfs_closedir (glusterfs_dir_t dirfd) +{ + int op_ret = -1; + libglusterfs_client_fd_ctx_t *fdctx = NULL; + + GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, dirfd, out); + fdctx = libgf_get_fd_ctx (dirfd); + + if (fdctx == NULL) { + errno = EBADF; + op_ret = -1; + goto out; + } + + op_ret = libgf_client_flush (fdctx->ctx, (fd_t *)dirfd); + fd_unref ((fd_t *)dirfd); + +out: + return op_ret; +} + static struct xlator_fops libgf_client_fops = { }; -- cgit