Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbdL0JTz (ORCPT ); Wed, 27 Dec 2017 04:19:55 -0500 Received: from smtpbgsg2.qq.com ([54.254.200.128]:57208 "EHLO smtpbgsg2.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751314AbdL0JTy (ORCPT ); Wed, 27 Dec 2017 04:19:54 -0500 X-QQ-mid: esmtp27t1514366388trsfzi23i X-QQ-SSF: A1000000000000F0FH100000000000R X-QQ-FEAT: JOVh5Yj1n8ZjkQ25C7edK1GFSnXLXtIukgX17aYUvKf6xhLA/NUuyErFYXoWI gRSrB6YXbm8iYd6t3Odk5JYpvd6qACZh67by/K971rTsPwiktvbyVlHTTWxPaeV8S/TgdNE Nz3HpXpvrBywtOilSbYHfpvOJXzDPT3huye/DNQm6OWhYiQQEjzcJPS1apSZXR4a5WNd7c7 VbeutVMrqRK5oOh6Jphi5nARGGPJvDMzwv3S22nvLrBDwLTORrR3Ki3seURomGmUg93SyJ2 iW13IPl6YEFjbzNHykCxZjwMg= X-QQ-GoodBg: 0 From: ChenGuanqiao To: hirofumi@mail.parknet.co.jp Cc: linux-kernel@vger.kernel.org, ChenGuanqiao Subject: [PATCH v5 0/2] fs: fat: add ioctl to modify fat filesystem partion volume label Date: Wed, 27 Dec 2017 17:17:12 +0800 Message-Id: <20171227091714.4566-1-chen.chenchacha@foxmail.com> X-Mailer: git-send-email 2.11.0 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign3 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1316 Lines: 42 The FAT filesystem partition volume label can be read with FAT_IOCTL_GET_VOLUME_LABEL and written with FAT_IOCTL_SET_VOLUME_LABEL. FAT volume label (volume name) is exactly same stored in boot sector and root directory. Thus, the boot sector just needs to be upgrade when the label writing. v5: 1. find the volume label entry through the scan function. 2. the volume label only retains the d-characters (reference from Ecma-107). v4: 1. read/write volume label from/to the location of the respective version. 2. correct volume label check reference from mkfs.fat. 3. fixed some code issue. v3: 1. write volume label both boot sector and root directory. v2: 1. add filesystem version check. 2. add diretory permissions check. 3. add volume label string check. 4. fixed part of return value. 5. fixed some indent issue. 6. remove sync_dirty_buffer(). ChenGuanqiao (2): fs: fat: Add fat filesystem partition volume label in local structure fs: fat: add ioctl method in fat filesystem driver fs/fat/dir.c | 29 +++++++++++ fs/fat/fat.h | 2 + fs/fat/file.c | 116 ++++++++++++++++++++++++++++++++++++++++++ fs/fat/inode.c | 15 ++++-- include/uapi/linux/msdos_fs.h | 2 + 5 files changed, 161 insertions(+), 3 deletions(-) -- 2.11.0