From f8a6cd1d2715fc13f130b7c76d8aea75de8b5133 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Thu, 9 Jul 2015 15:31:30 +0530 Subject: posix: Add lease() fop Change-Id: I20007d7ff4536ae8180425c84a1aa7863a6f2447 BUG: 1319992 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/11598 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra Talur --- xlators/storage/posix/src/posix-messages.h | 10 +++++++++- xlators/storage/posix/src/posix.c | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/storage/posix/src/posix-messages.h b/xlators/storage/posix/src/posix-messages.h index 4efdef0a6b9..0c0eb059270 100644 --- a/xlators/storage/posix/src/posix-messages.h +++ b/xlators/storage/posix/src/posix-messages.h @@ -45,7 +45,7 @@ */ #define POSIX_COMP_BASE GLFS_MSGID_COMP_POSIX -#define GLFS_NUM_MESSAGES 108 +#define GLFS_NUM_MESSAGES 109 #define GLFS_MSGID_END (POSIX_COMP_BASE + GLFS_NUM_MESSAGES + 1) /* Messaged with message IDs */ #define glfs_msg_start_x POSIX_COMP_BASE, "Invalid: Start of messages" @@ -925,6 +925,14 @@ * */ +#define P_MSG_LEASE_DISABLED (POSIX_COMP_BASE + 109) +/*! + * @messageid + * @diagnosis + * @recommendedaction + * + */ + /*------------*/ #define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages" diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 8cce4be1c34..3a2fc13d2b1 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -5676,6 +5676,20 @@ out: return 0; } +int32_t +posix_lease (call_frame_t *frame, xlator_t *this, + loc_t *loc, struct gf_lease *lease, dict_t *xdata) +{ + struct gf_lease nullease = {0, }; + + gf_msg (this->name, GF_LOG_CRITICAL, EINVAL, P_MSG_LEASE_DISABLED, + "\"features/leases\" translator is not loaded. You need" + "to use it for proper functioning of your application"); + + STACK_UNWIND_STRICT (lease, frame, -1, ENOSYS, &nullease, NULL); + return 0; +} + static int gf_posix_lk_log; int32_t @@ -7083,6 +7097,7 @@ struct xlator_fops fops = { #ifdef HAVE_SEEK_HOLE .seek = posix_seek, #endif + .lease = posix_lease, }; struct xlator_cbks cbks = { -- cgit