From owner-freebsd-fs@FreeBSD.ORG Sun Feb 19 13:53:30 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AFDC16A420 for ; Sun, 19 Feb 2006 13:53:30 +0000 (GMT) (envelope-from mirya@matrix.ua) Received: from gw.matrix.kiev.ua (gw.matrix.kiev.ua [213.159.235.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21F2B43D46 for ; Sun, 19 Feb 2006 13:53:29 +0000 (GMT) (envelope-from mirya@matrix.ua) Received: by gw.matrix.kiev.ua (Postfix, from userid 426) id 353A114BB2D; Sun, 19 Feb 2006 15:53:28 +0200 (EET) Received: from miryahost.matrix.local (unknown [192.168.1.27]) by gw.matrix.kiev.ua (Postfix) with ESMTP id DE0DA14BB20 for ; Sun, 19 Feb 2006 15:53:27 +0200 (EET) From: Kyryll A Mirnenko aka Mirya Organization: MATIX.ua To: freebsd-fs@freebsd.org Date: Sun, 19 Feb 2006 15:53:25 +0200 User-Agent: KMail/1.8.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602191553.26338.mirya@matrix.ua> X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on gw.matrix.kiev.ua X-Spam-Level: X-Spam-Status: No, score=-100.6 required=5.0 tests=AWL,BAYES_50, USER_IN_WHITELIST autolearn=no version=3.0.2 Subject: RDBMS features into VFS X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2006 13:53:30 -0000 Consider this a feature request. THE PROBLEM The userland is missing "ORDER BY" and "LIMIT"-like features for directory reading. E.g. The only avaliable API is readdir() interating over the directory in unspecified order. On other hand most filebrowsers utilize file sorting extensively (mc, for, ex, will sort files by name as default option). When working with large directories this slowdowns operation much - e.g. the filebrowser must read huge filelist, then sort it and output only a small part of it - despite the fact some FS have BTREE index for filenames. Other potentional candidates for sorting are: - mtime - size - extattrs THE SOLUTION Add an api into VFS layer allowing to fetch a sorted filelist and limiting the output to a range from N to M, like it does "SELECT ... FROM ... ORDER BY field LIMIT a, b" in MySQL notation. Underlying FS'es are allowed not to add any optimized API for this operation, if so VFS implements it by itself THE USE Someone may criticise the exaple above as huge directories in REAL fs are exception, but the main application comes when talking about syntetic FS. After fusefs was ported to FreeBSD it became possible to represent some business logic as filesystem and "merge" it into the real one w/o digging in the kernel and thinking much about how a bug in your code can make the whole system crash. FS interface allows programmers not to care much about the user iface as the user is free to use any HTML editor he/she prefers to edit a piece of data provided by an application - reading and writing will be forwardrd to aprop. backend via fuse. The issue is most virtual "directories" in such systems will contain hundred thousand of "files" (like customers table) so while underlying RDBMS can effectively sort (the fields not representing standart file attributes are mapped to extattr) and chunk the data, the fs layer is not aware about that. -- Regards, Mirya ICQ #313898202 From owner-freebsd-fs@FreeBSD.ORG Sat Feb 25 11:44:44 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC18016A420 for ; Sat, 25 Feb 2006 11:44:44 +0000 (GMT) (envelope-from rachu_sm@yahoo.com) Received: from web34401.mail.mud.yahoo.com (web34401.mail.mud.yahoo.com [66.163.178.150]) by mx1.FreeBSD.org (Postfix) with SMTP id 1C42E43D48 for ; Sat, 25 Feb 2006 11:44:44 +0000 (GMT) (envelope-from rachu_sm@yahoo.com) Received: (qmail 93337 invoked by uid 60001); 25 Feb 2006 11:44:43 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=BHSJFMV6Q361zpIqPrc3mdZ2sQ00L6SNKD8dbVw/ZqHeR7BhK+NEAa6JJ88bWnve6jvWgiSXHH5eOtrig301z8SLQmF1fFTVxirR3tYiYva4IIe2AXB53mYZo95bD/bEkx5MCf/60V9+Zn3Sa3Ie2GYLe4FnqYmToDj/gWm/hf0= ; Message-ID: <20060225114443.93335.qmail@web34401.mail.mud.yahoo.com> Received: from [61.17.14.70] by web34401.mail.mud.yahoo.com via HTTP; Sat, 25 Feb 2006 03:44:43 PST Date: Sat, 25 Feb 2006 03:44:43 -0800 (PST) From: rachana maniyar To: freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1018811139-1140867883=:92114" Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: queries providing write support to ufs2 in linux X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2006 11:44:44 -0000 --0-1018811139-1140867883=:92114 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit --------------------------------- Brings words and photos together (easily) with PhotoMail - it's free and works with Yahoo! Mail. --0-1018811139-1140867883=:92114 Content-Type: message/rfc822 Content-Transfer-Encoding: 8bit Received: from [61.17.14.70] by web34401.mail.mud.yahoo.com via HTTP; Sat, 25 Feb 2006 03:40:30 PST Date: Sat, 25 Feb 2006 03:40:30 -0800 (PST) From: rachana maniyar Subject: queries providing write support to ufs2 in linux To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2108657299-1140867630=:89855" Content-Transfer-Encoding: 8bit Content-Length: 1423 --0-2108657299-1140867630=:89855 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit hello, Currently I am trying to give write support to the UFS2 file system in linux 2.6.10 which is a native file system for FreeBSD operating system.Right now the UFS2 has just read-only support in linux. The current status is that i have been able to create the directories successfully in linux partition with UFS2 mounted on it without the freebsd partition getting corrupted. So whenever i try to open a file or write sm data into it,the process terminates out giving segmentation fault n this fault is sm divide by 0 error. I have been able to trace out this error also,where does it come from.its the following macro which uses s_spc which has 0 value right at the time of file system getting registered.n hence the divide by 0 error occurs. /* linux-2.6.10/include/linux/ufs_fs.h */ #define ufs_cbtocylno(bno) \ 266 ((bno) * uspi->s_nspf / uspi->s_spc) so here the uspi->s_spc which is sectors per cylinder has value zero.. Also one thing i noticed while tracing down all the parameters of the superblock and cylinder group is that most of them have zero values assigned right from the start when the file system is mounted on linux. so wht can be done in regards to this problem?? n the other thing it that while opening a file or writing data into a file wht care is to be taken or wht is the procedure?? Well i would also like to know wht is the exact disk layout of the UFS2 file system..?? if anyone can give answers to the above questions ,it will be really helpful for me.. thanking you in advance.. Rachana. -- The only thing Constant is Change !!! So try to be constant :-) \n\n",0] ); D(["ce"]); //--> --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. --0-2108657299-1140867630=:89855 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" hello, Currently I am trying to give write support to the UFS2 file system in linux 2.6.10 which is a native file system for FreeBSD operating system.Right now the UFS2 has just read-only support in linux. The current status is that i have been able to create the directories successfully in linux partition with UFS2 mounted on it without the freebsd partition getting corrupted. So whenever i try to open a file or write sm data into it,the process terminates out giving segmentation fault n this fault is sm divide by 0 error. I have been able to trace out this error also,where does it come from.its the following macro which uses s_spc which has 0 value right at the time of file system getting registered.n hence the divide by 0 error occurs. /* linux-2.6.10/include/linux/ufs_fs.h */ #define ufs_cbtocylno(bno) \ 266 ((bno) * uspi->s_nsp f / uspi->s_spc) so here the uspi->s_spc which is sectors per cylinder has value zero.. Also one thing i noticed while tracing down all the parameters of the superblock and cylinder group is that most of them have zero values assigned right from the start when the file system is mounted on linux. so wht can be done in regards to this problem?? n the other thing it that while opening a file or writing data into a file wht care is to be taken or wht is the procedure?? Well i would also like to know wht is the exact disk layout of the UFS2 file system..?? if anyone can give answers to the above questions ,it will be really helpful for me.. thanking you in advance.. Rachana. _________________________________________________________________ Yahoo! Mail Bring photos to life! [1]New PhotoMail makes sharing a breeze. References 1. http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=39174/*http://photomail.mail.yahoo.com --0-2108657299-1140867630=:89855-- --0-1018811139-1140867883=:92114-- From owner-freebsd-fs@FreeBSD.ORG Sat Feb 25 14:25:58 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AE9016A420 for ; Sat, 25 Feb 2006 14:25:58 +0000 (GMT) (envelope-from weilei84@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABC0743D62 for ; Sat, 25 Feb 2006 14:25:46 +0000 (GMT) (envelope-from weilei84@gmail.com) Received: by zproxy.gmail.com with SMTP id z31so535984nzd for ; Sat, 25 Feb 2006 06:25:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:mime-version:content-type; b=mUtsfTMMksKB5v1MRX/tf4e24VT8mf5fczGtpuEmNYJoExcI6eEOPh+MHF1UxVqzUGxzGf6uWlikaUeqjWInRB8q6uXKh/9gQtmd2VEXXAZRRtyIxvoaD6Zgi1PW2yBOAaBmEaOXWJOpIGbP9myMH8gk2ibiuSxqz2wQ67KLpdQ= Received: by 10.36.9.17 with SMTP id 17mr1805150nzi; Sat, 25 Feb 2006 06:25:46 -0800 (PST) Received: by 10.36.12.11 with HTTP; Sat, 25 Feb 2006 06:25:46 -0800 (PST) Message-ID: <36fee7420602250625h7271d694i7bfc9e69eda8ade7@mail.gmail.com> Date: Sat, 25 Feb 2006 22:25:46 +0800 From: "Wei Lei" To: freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Manish Rai Jain Subject: Doubt about ntfs code: lockmgr with LK_INTERLOCK flag X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2006 14:25:58 -0000 Hi list, Nice to be here =3D) I am new here so just hope my first post doesn't mismatch the topic. I have a doubt when understanding the ntfs code with freebsd 5.4: ntfs_subr.c, function ntfs_ntget(). I understand that lockmgr() here is trying to get an exclusive lock and release the mutex ip->i_interlock, so that the protection can expand from use_count to the whole ntnode. But what's the significance of having such a mechanism? What could possibly happen if I do a mtx_unlock first then acquire the exclusive lock? This is the code in ntfs_subr.c 352 int 353 ntfs_ntget(ip) 354 struct ntnode *ip; 355 { 356 dprintf((*"ntfs_ntget: get ntnode %d: %p, usecount: %d\n"*, 357 ip->i_number, ip, ip->i_usecount)); 358 359 mtx_lock(&ip->i_interlock); 360 ip->i_usecount++; 361 lockmgr(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock, 362 NULL); 363 364 return 0; 365 } Regards, Wei Lei