From patchwork Thu Aug 23 12:13:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goffredo Baroncelli X-Patchwork-Id: 1366811 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F1459DF2AB for ; Thu, 23 Aug 2012 12:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933717Ab2HWMNL (ORCPT ); Thu, 23 Aug 2012 08:13:11 -0400 Received: from smtp206.alice.it ([82.57.200.102]:46785 "EHLO smtp206.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932702Ab2HWMNJ (ORCPT ); Thu, 23 Aug 2012 08:13:09 -0400 Received: from venice.bhome (151.24.44.165) by smtp206.alice.it (8.6.023.02) (authenticated as kreijack@alice.it) id 500F3F95051BAB6D for linux-btrfs@vger.kernel.org; Thu, 23 Aug 2012 14:13:08 +0200 Subject: [PATCH v0 4/4] Btrfs sysfs support documentation. To: linux-btrfs@vger.kernel.org From: Goffredo Baroncelli Date: Thu, 23 Aug 2012 14:13:50 +0200 Message-ID: <20120823121337.12203.33725.stgit@venice.bhome> In-Reply-To: <20120823120505.12203.11658.stgit@venice.bhome> References: <20120823120505.12203.11658.stgit@venice.bhome> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Update of the Documentation/filesystes/btrfs.txt file. --- 0 files changed -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/filesystems/btrfs.txt b/Documentation/filesystems/btrfs.txt index 7671352..35840ab 100644 --- a/Documentation/filesystems/btrfs.txt +++ b/Documentation/filesystems/btrfs.txt @@ -89,3 +89,78 @@ btrfsck: do a limited check of the FS extent trees. btrfs-debug-tree: print all of the FS metadata in text form. Example: btrfs-debug-tree /dev/sda2 >& big_output_file + + + + SYSFS SUPPORT + ============= + +If the option CONFIG_BTRFS_FS_SYSFS is enabled, BTRFS exports some +information via the sysfs filesystem. +Todate these information are read-only. + +The information exported are related to both the devices and the filesystems. +When a devices is registred (for example via the btrfs filesystem scan +command), BTRFS creates the following entries under /sys/fs/btrfs: + +/sys/fs/btrfs: + + - devices -> information per device basis + - filesystem -> information per filesystem basis + +/sys/fs/btrfs/devices/: + + - bytes_used + - devid + - disk_total_bytes + - fsid -> fielsystem UUID + - generation + - major [*] + - minor [*] + - missing + - name -> device name (eg: /dev/sda) + - total_bytes + - write_errors -> error info + - corruption_errors -> error info + - read_errors -> error info + - generation_errors -> error info + - flush_errors -> error info + - writeable + +[*] These information are available only after the mounting of the +filesystem. + +/sys/fs/btrfs/filesystem//fs_info: + + - balance_cancel_req -> balance status information + - balance_pause_req -> balance status information + - balance_running -> balance status information + - fs_state + - generation + - label -> label of the filesystem + - last_trans_committed + - scrub_cancel_req -> scrub status information + - scrub_pause_req -> scrub status information + - scrubs_paused -> scrub status information + - scrubs_running -> scrub status information + +/sys/fs/btrfs/filesystem//fs_devices: + + - latest_devid + - latest_trans + - missing_devices + - num_can_discard + - open_devices + - opened + - rw_devices + - seeding + - total_rw_bytes + +The filesystems information are split in two section (fs_info and fs_devices) +because the fs_devices entries are available after the scan of the device(s), +but the fs_info entries are available only after the mount of the +filesystem. + +The link between the filesystem and the device(s) is the fsid == +filesystem-UUID. +