summaryrefslogtreecommitdiffstats
path: root/xlators/mount
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2013-07-31 17:55:03 -0400
committerAnand Avati <avati@redhat.com>2013-08-01 21:02:26 -0700
commitbc9cf5ba83dffbc2fb5a6821a6f40e6acff59897 (patch)
treea9f0caebb4817b62d43532daa1b3c69319ff4a13 /xlators/mount
parent6235e8e956ce6d72c88ddb3ad81c0842ee4d089c (diff)
fuse-bridge: update to fuse protocol minor version 16 (Linux)
7.14 - Splice write support to fuse device node. No gluster changes required besides header update. 7.15 - Store/retrieve notification support. No gluster changes required besides header update. 7.16 - BATCH_FORGET request support. Implement a handler for BATCH_FORGET requests and update the header. - Updated ioctl() ABI. No gluster changes required besides header update. BUG: 990744 Change-Id: If3061a720ba566ee6731ad8b77cdc665d8fbf781 Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-on: http://review.gluster.org/5449 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index efabf9f6941..945222e93a8 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -941,12 +941,23 @@ fuse_xlator_forget (xlator_t *this, inode_t *inode)
return 0;
}
+static inline void
+do_forget(xlator_t *this, uint64_t unique, uint64_t nodeid, uint64_t nlookup)
+{
+ inode_t *fuse_inode = fuse_ino_to_inode(nodeid, this);
+
+ fuse_log_eh(this, "%"PRIu64": FORGET %"PRIu64"/%"PRIu64" gfid: (%s)",
+ unique, nodeid, nlookup, uuid_utoa(fuse_inode->gfid));
+
+ inode_forget(fuse_inode, nlookup);
+ inode_unref(fuse_inode);
+}
+
static void
fuse_forget (xlator_t *this, fuse_in_header_t *finh, void *msg)
{
struct fuse_forget_in *ffi = msg;
- inode_t *fuse_inode = NULL;
if (finh->nodeid == 1) {
GF_FREE (finh);
@@ -957,16 +968,26 @@ fuse_forget (xlator_t *this, fuse_in_header_t *finh, void *msg)
"%"PRIu64": FORGET %"PRIu64"/%"PRIu64,
finh->unique, finh->nodeid, ffi->nlookup);
- fuse_inode = fuse_ino_to_inode (finh->nodeid, this);
+ do_forget(this, finh->unique, finh->nodeid, ffi->nlookup);
+
+ GF_FREE (finh);
+}
- fuse_log_eh (this, "%"PRIu64": FORGET %"PRIu64"/%"PRIu64" gfid: (%s)",
- finh->unique, finh->nodeid, ffi->nlookup,
- uuid_utoa (fuse_inode->gfid));
+static void
+fuse_batch_forget(xlator_t *this, fuse_in_header_t *finh, void *msg)
+{
+ struct fuse_batch_forget_in *fbfi = msg;
+ struct fuse_forget_one *ffo = (struct fuse_forget_one *) (fbfi + 1);
+ int i;
- inode_forget (fuse_inode, ffi->nlookup);
- inode_unref (fuse_inode);
+ gf_log("glusterfs-fuse", GF_LOG_TRACE,
+ "%"PRIu64": BATCH_FORGET %"PRIu64"/%"PRIu32,
+ finh->unique, finh->nodeid, fbfi->count);
- GF_FREE (finh);
+ for (i = 0; i < fbfi->count; i++)
+ do_forget(this, finh->unique, ffo[i].nodeid, ffo[i].nlookup);
+
+ GF_FREE(finh);
}
static int
@@ -5868,7 +5889,7 @@ static fuse_handler_t *fuse_std_ops[FUSE_OP_HIGH] = {
/* [FUSE_IOCTL] */
/* [FUSE_POLL] */
/* [FUSE_NOTIFY_REPLY] */
- /* [FUSE_BATCH_FORGET] */
+ [FUSE_BATCH_FORGET]= fuse_batch_forget,
[FUSE_FALLOCATE] = fuse_fallocate,
[FUSE_READDIRPLUS] = fuse_readdirp,
};