summaryrefslogtreecommitdiffstats
path: root/xlators/features/read-only
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/read-only')
-rw-r--r--xlators/features/read-only/src/read-only-common.c15
-rw-r--r--xlators/features/read-only/src/read-only-common.h4
-rw-r--r--xlators/features/read-only/src/read-only.c1
3 files changed, 20 insertions, 0 deletions
diff --git a/xlators/features/read-only/src/read-only-common.c b/xlators/features/read-only/src/read-only-common.c
index b4e4289356b..f4851a4be40 100644
--- a/xlators/features/read-only/src/read-only-common.c
+++ b/xlators/features/read-only/src/read-only-common.c
@@ -196,6 +196,21 @@ ro_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, dict_
return 0;
}
+int32_t
+ro_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
+ off_t offset, size_t len, dict_t *xdata)
+{
+ if (is_readonly_or_worm_enabled (frame, this))
+ STACK_UNWIND_STRICT (fallocate, frame, -1, EROFS, NULL, NULL,
+ xdata);
+ else
+ STACK_WIND_TAIL (frame, FIRST_CHILD (this),
+ FIRST_CHILD(this)->fops->fallocate, fd, mode,
+ offset, len, xdata);
+ return 0;
+}
+
+
int
ro_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
dev_t rdev, mode_t umask, dict_t *xdata)
diff --git a/xlators/features/read-only/src/read-only-common.h b/xlators/features/read-only/src/read-only-common.h
index 6d8c38faeb8..ec629bd5660 100644
--- a/xlators/features/read-only/src/read-only-common.h
+++ b/xlators/features/read-only/src/read-only-common.h
@@ -111,3 +111,7 @@ ro_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
int32_t
ro_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
const char *name, dict_t *xdata);
+
+int32_t
+ro_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
+ off_t offset, size_t len, dict_t *xdata);
diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c
index 8733a40abce..75d6d104d45 100644
--- a/xlators/features/read-only/src/read-only.c
+++ b/xlators/features/read-only/src/read-only.c
@@ -115,6 +115,7 @@ struct xlator_fops fops = {
.entrylk = ro_entrylk,
.fentrylk = ro_fentrylk,
.lk = ro_lk,
+ .fallocate = ro_fallocate,
};
struct xlator_cbks cbks = {