From patchwork Fri Jan 21 21:44:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 496811 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0LLjNIS028135 for ; Fri, 21 Jan 2011 21:45:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753891Ab1AUVpw (ORCPT ); Fri, 21 Jan 2011 16:45:52 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:48276 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753617Ab1AUVpw (ORCPT ); Fri, 21 Jan 2011 16:45:52 -0500 Received: by mail-iy0-f174.google.com with SMTP id 18so2123221iyj.19 for ; Fri, 21 Jan 2011 13:45:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=O0dDgs7WmY4ax3EW30uP6NUzWtOe4OM6HbayBTlWlww=; b=tdrSFfkhU6HK9tJcNbxXYe6BAzXMoUTM2PYXqqayTFfS1oWxVbJPGAHZIGUTs1km87 4LF6YzJ33q14QMBRZrcFw7EgP9rcTQRoGi6Yx144nsHqlxoNQPxR2+YxDT3QiWyqxZJw HiVwqe79LrXJpjO8fjpKgI+WhXtkZsQneS4Rk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=lPGDiRng4uFLfth2KaBmENIMuul6PJ+eGwebV4KRdLFNuAbwOjJrA0GpiURnOIsUCt iSUYjT4317WX0e9N2X8+fBE61lJAo1tbUBWe0BGxoDatLSW5X0BAbrCCtS7flN23v+Go hcfGRc1z3bn5SnlRGk3HO2Lcn4wkliUC7+1yU= Received: by 10.42.217.73 with SMTP id hl9mr1481022icb.45.1295646351886; Fri, 21 Jan 2011 13:45:51 -0800 (PST) Received: from localhost ([32.97.110.58]) by mx.google.com with ESMTPS id i2sm7322774icv.3.2011.01.21.13.45.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 21 Jan 2011 13:45:51 -0800 (PST) From: shirishpargaonkar@gmail.com To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Shirish Pargaonkar Subject: [PATCH 1/3]] cifs: Add idmap data structures and defines (try #3) Date: Fri, 21 Jan 2011 15:44:13 -0600 Message-Id: <1295646253-21852-1-git-send-email-shirishpargaonkar@gmail.com> X-Mailer: git-send-email 1.6.0.2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 21 Jan 2011 21:45:53 +0000 (UTC) diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h index ac51cd2..4bd0680 100644 --- a/fs/cifs/cifs_fs_sb.h +++ b/fs/cifs/cifs_fs_sb.h @@ -45,6 +45,10 @@ struct cifs_sb_info { struct rb_root tlink_tree; spinlock_t tlink_tree_lock; + struct rb_root uidtree; + spinlock_t siduidlock; + struct rb_root gidtree; + spinlock_t sidgidlock; struct tcon_link *master_tlink; struct nls_table *local_nls; unsigned int rsize; diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h index c4ae7d0..6c26e7f 100644 --- a/fs/cifs/cifsacl.h +++ b/fs/cifs/cifsacl.h @@ -74,6 +74,12 @@ struct cifs_wksid { char sidname[SIDNAMELENGTH]; } __attribute__((packed)); +struct cifs_sid_id { + struct rb_node rbnode; + struct cifs_sid sid; + unsigned long id; +} __attribute__((packed)); + extern int match_sid(struct cifs_sid *); extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *); diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index a8323f1..36182e3 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -122,6 +122,12 @@ cifs_read_super(struct super_block *sb, void *data, spin_lock_init(&cifs_sb->tlink_tree_lock); cifs_sb->tlink_tree = RB_ROOT; + spin_lock_init(&cifs_sb->siduidlock); + cifs_sb->uidtree = RB_ROOT; + + spin_lock_init(&cifs_sb->sidgidlock); + cifs_sb->gidtree = RB_ROOT; + rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY); if (rc) { kfree(cifs_sb);