summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2015-07-09 15:31:30 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-04-21 04:32:12 -0700
commitf8a6cd1d2715fc13f130b7c76d8aea75de8b5133 (patch)
treeb1742dfdc5b7aa3f2b0f1ec4d39fa17272a05a92 /xlators/storage/posix/src
parentba9c40ab4ee238bb6f5e6e275f339484690bc84e (diff)
posix: Add lease() fop
Change-Id: I20007d7ff4536ae8180425c84a1aa7863a6f2447 BUG: 1319992 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/11598 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src')
-rw-r--r--xlators/storage/posix/src/posix-messages.h10
-rw-r--r--xlators/storage/posix/src/posix.c15
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 = {