Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754163Ab0ANOfD (ORCPT ); Thu, 14 Jan 2010 09:35:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753931Ab0ANOfB (ORCPT ); Thu, 14 Jan 2010 09:35:01 -0500 Received: from mail-qy0-f194.google.com ([209.85.221.194]:53412 "EHLO mail-qy0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753623Ab0ANOfA (ORCPT ); Thu, 14 Jan 2010 09:35:00 -0500 From: Nitin Gupta To: Hugh Dickins , Pekka Enberg Cc: Andrew Morton , Al Viro , Christoph Hellwig , Jens Axboe , Andi Kleen , linux-kernel Subject: [PATCH] [mmotm] comment on swap notify locking constraints Date: Thu, 14 Jan 2010 20:02:51 +0530 Message-Id: <1263479571-7873-1-git-send-email-ngupta@vflare.org> X-Mailer: git-send-email 1.6.2.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 33 A block device makes swap_slot_free_notify() callback when the last reference to a swap slot is dropped. This callback is made under swap_lock and often with lock for corresponding swapcache page also held. This is a note of warning for registered callback function which must meet these constraints. Signed-off-by: Nitin Gupta --- include/linux/blkdev.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 14b95a3..e3dcff6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1295,6 +1295,7 @@ struct block_device_operations { unsigned long long); int (*revalidate_disk) (struct gendisk *); int (*getgeo)(struct block_device *, struct hd_geometry *); + /* this callback is with swap_lock and often page lock also held */ void (*swap_slot_free_notify) (struct block_device *, unsigned long); struct module *owner; }; -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/