From patchwork Thu Feb 5 21:25:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 22305 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 81FB6DDE19 for ; Fri, 6 Feb 2009 18:42:01 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LVLKU-0001VL-UD; Fri, 06 Feb 2009 07:40:50 +0000 Received: from smtp4-g21.free.fr ([212.27.42.4]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LVBoV-0003ba-Dj for linux-mtd@lists.infradead.org; Thu, 05 Feb 2009 21:31:11 +0000 Received: from smtp4-g21.free.fr (localhost [127.0.0.1]) by smtp4-g21.free.fr (Postfix) with ESMTP id 9C37D4C8167; Thu, 5 Feb 2009 22:31:05 +0100 (CET) Received: from localhost.localdomain (home.chty.org [82.229.223.164]) by smtp4-g21.free.fr (Postfix) with ESMTP id AF4D94C8168; Thu, 5 Feb 2009 22:31:02 +0100 (CET) From: Corentin Chary To: linux-mtd@lists.infradead.org Subject: [PATCH 2/2] UBI: add fsync capability Date: Thu, 5 Feb 2009 22:25:52 +0100 Message-Id: <1233869152-23992-2-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.1.2 In-Reply-To: <1233869152-23992-1-git-send-email-corentincj@iksaif.net> References: <1233869152-23992-1-git-send-email-corentincj@iksaif.net> X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Note: SpamAssassin invocation failed X-Mailman-Approved-At: Fri, 06 Feb 2009 02:40:50 -0500 Cc: Corentin Chary X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now, we can call fsync() on an UBI volume. Signed-off-by: Corentin Chary --- drivers/mtd/ubi/cdev.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index f9631eb..9e2a108 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -186,6 +186,17 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin) return new_offset; } +static int vol_cdev_fsync(struct file *file, struct dentry *dentry, + int datasync) +{ + struct ubi_volume_desc *desc = file->private_data; + struct ubi_volume *vol = desc->vol; + struct ubi_device *ubi = vol->ubi; + + return ubi_sync(ubi->ubi_num); +} + + static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, loff_t *offp) { @@ -1053,6 +1064,7 @@ const struct file_operations ubi_vol_cdev_operations = { .llseek = vol_cdev_llseek, .read = vol_cdev_read, .write = vol_cdev_write, + .fsync = vol_cdev_fsync, .unlocked_ioctl = vol_cdev_ioctl, .compat_ioctl = vol_cdev_compat_ioctl, };