diff options
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix-messages.h | 10 | ||||
-rw-r--r-- | xlators/storage/posix/src/posix.c | 15 |
2 files changed, 24 insertions, 1 deletions
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 = { |