Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2224929/?format=api
{ "id": 2224929, "url": "http://patchwork.ozlabs.org/api/patches/2224929/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260419161620.564854-1-jkoolstra@xs4all.nl/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/projects/12/?format=api", "name": "Linux CIFS Client", "link_name": "linux-cifs-client", "list_id": "linux-cifs.vger.kernel.org", "list_email": "linux-cifs@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260419161620.564854-1-jkoolstra@xs4all.nl>", "list_archive_url": null, "date": "2026-04-19T16:16:16", "name": "[v2] vfs: replace ints with enum component_type for LAST_XXX", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5ac3bd5473a8802168343d2a5dc7c2daa66acc9d", "submitter": { "id": 92813, "url": "http://patchwork.ozlabs.org/api/people/92813/?format=api", "name": "Jori Koolstra", "email": "jkoolstra@xs4all.nl" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260419161620.564854-1-jkoolstra@xs4all.nl/mbox/", "series": [ { "id": 500518, "url": "http://patchwork.ozlabs.org/api/series/500518/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=500518", "date": "2026-04-19T16:16:16", "name": "[v2] vfs: replace ints with enum component_type for LAST_XXX", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/500518/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2224929/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2224929/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10916-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-cifs@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=xs4all.nl header.i=@xs4all.nl header.a=rsa-sha256\n header.s=xs4all01 header.b=KTn6pVPn;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10916-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=xs4all.nl header.i=@xs4all.nl\n header.b=\"KTn6pVPn\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=195.121.94.186", "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=xs4all.nl", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=xs4all.nl" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzDJy442bz1yD4\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 02:16:50 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id F12073019527\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 19 Apr 2026 16:16:47 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7EAE22512DE;\n\tSun, 19 Apr 2026 16:16:47 +0000 (UTC)", "from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl\n [195.121.94.186])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id CD7796DCE1\n\tfor <linux-cifs@vger.kernel.org>; Sun, 19 Apr 2026 16:16:44 +0000 (UTC)", "from smtp.kpnmail.nl (unknown [10.31.155.5])\n\tby ewsoutbound.so.kpn.org (Halon) with ESMTPS\n\tid 277ac91a-3c0b-11f1-89e1-00505699b430;\n\tSun, 19 Apr 2026 18:16:42 +0200 (CEST)", "from daedalus.home (unknown [178.227.25.188])\n\tby smtp.xs4all.nl (Halon) with ESMTPSA\n\tid 245c0bbb-3c0b-11f1-8d42-00505699b758;\n\tSun, 19 Apr 2026 18:16:42 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776615407; cv=none;\n b=grlsf5eGKIwy34IJ2A38XNTcblARsK1Q/GRVuBwFM2QjKgt6KSR0ZhTijuVYyfuVZMO9ochOvgiz/w6KJWuX0U0B6eEMMwRLoUOxw3TRZzQJrGu1Wc/n0VC0Kvbhm8Mnk6zcgFkmuCH1MEAhhA91hBSauBT85TlXvPph+NZbZM8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776615407; c=relaxed/simple;\n\tbh=+fySva1/0STurilohwVEd0xk9CXKnmouisbr5rNdygg=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=WtOMIBJ+ukqkpsdJTTYgxha67dD1d/5cM95kSUNutjmTViN7jPROGFmwebOZBWRh2FaP5AKtmJGozq26W9bi2BO+MDeoWX1yAmI+Hb856wTMCt0xYTHjrNA991N+Y2CP/wk0kvv8Icqni+yFkamIsAPdtP0gOKTg1JrKpyWaP2c=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=xs4all.nl;\n spf=pass smtp.mailfrom=xs4all.nl;\n dkim=pass (2048-bit key) header.d=xs4all.nl header.i=@xs4all.nl\n header.b=KTn6pVPn; arc=none smtp.client-ip=195.121.94.186", "X-KPN-MessageId": "277ac91a-3c0b-11f1-89e1-00505699b430", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=xs4all.nl; s=xs4all01;\n\th=mime-version:message-id:date:subject:to:from;\n\tbh=AO9yyyXYcUIlzcELFTB/fVBRpc9JQiMi43pJ8vFzZiU=;\n\tb=KTn6pVPnZ251NzqZgwLwdeEPXoUDzjB6vnENk3DsFSc3CxUjr7dUxd17FwY8mwXWwUPZtZjhfcyhC\n\t 8DeXFdoAWNs1g9hNgJfpEvtoByzmyJcZ2vBT53UHALK8HQvdGJ6/9mmrYnDlKinCaS+uktdBaIX9pX\n\t YxYg9O+HY+0lo6n0vSl/ecpnF+RPSJrMjwGmTs7no8dPGLSs9/VJFBEsfuPAqrt2a5P8G3qOpyhOTj\n\t n4dH6A7itxBxrbpnCc1je/ijOfG6Do2D6zW2gYkkcZrA7OF3GS+Z/7HLI2uEcE4BmfebadbKJrDPnh\n\t qIv5FoiE7rhAtQKlcBTTfQrIMIQH0jw==", "X-KPN-MID": "33|tZXO9JTZuUtD3R+qDXFGH1CPeJCm/ImX797uB4uuzTfnDuq3hfei3VFbpm3c/nl\n wEtvUAltwkiGt78XU070r0WeaYjPDyAkU2JNjrWjDdTs=", "X-KPN-VerifiedSender": "Yes", "X-CMASSUN": "33|ywTOZkHkiTvDH1K1Xfj0XCSYHd5E0S8PG97C6LQzxxAu3u638FQ8QdWNfROOc5q\n 0oCWqyMWhvIEX6LR8jQXwkA==", "From": "Jori Koolstra <jkoolstra@xs4all.nl>", "To": "Alexander Viro <viro@zeniv.linux.org.uk>,\n\tChristian Brauner <brauner@kernel.org>,\n\tJan Kara <jack@suse.cz>,\n\tNamjae Jeon <linkinjeon@kernel.org>,\n\tSteve French <smfrench@gmail.com>,\n\tSergey Senozhatsky <senozhatsky@chromium.org>,\n\tTom Talpey <tom@talpey.com>", "Cc": "Jori Koolstra <jkoolstra@xs4all.nl>,\n\tNeilBrown <neil@brown.name>,\n\tAmir Goldstein <amir73il@gmail.com>,\n\tJeff Layton <jlayton@kernel.org>,\n\tMateusz Guzik <mjguzik@gmail.com>,\n\tlinux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and\n infrastructure)),\n\tlinux-kernel@vger.kernel.org (open list),\n\tlinux-cifs@vger.kernel.org (open list:KERNEL SMB3 SERVER (KSMBD))", "Subject": "[PATCH v2] vfs: replace ints with enum component_type for LAST_XXX", "Date": "Sun, 19 Apr 2026 18:16:16 +0200", "Message-ID": "<20260419161620.564854-1-jkoolstra@xs4all.nl>", "X-Mailer": "git-send-email 2.53.0", "Precedence": "bulk", "X-Mailing-List": "linux-cifs@vger.kernel.org", "List-Id": "<linux-cifs.vger.kernel.org>", "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "Several functions in namei.c take an \"int *type\" parameter, such as\nfilename_parentat(). To know what values this can take you have to find\nthe anonymous struct that defines the LAST_XXX values. I would argue\nthat the readability of the code is improved by making this an explicit\ntype.\n\nSigned-off-by: Jori Koolstra <jkoolstra@xs4all.nl>\nReviewed-by: Jan Kara <jack@suse.cz>\n\n---\n\nv2: move back to LAST_XXX and change int to component_type in\nfs/smb/server/vfs.c.\n\n---\n fs/namei.c | 41 ++++++++++++++++++++++-------------------\n fs/smb/server/vfs.c | 5 +++--\n include/linux/namei.h | 4 ++--\n 3 files changed, 27 insertions(+), 23 deletions(-)", "diff": "diff --git a/fs/namei.c b/fs/namei.c\nindex 9e5500dad14f..a880454a6415 100644\n--- a/fs/namei.c\n+++ b/fs/namei.c\n@@ -721,15 +721,15 @@ EXPORT_SYMBOL(path_put);\n \n #define EMBEDDED_LEVELS 2\n struct nameidata {\n-\tstruct path\tpath;\n-\tstruct qstr\tlast;\n-\tstruct path\troot;\n-\tstruct inode\t*inode; /* path.dentry.d_inode */\n-\tunsigned int\tflags, state;\n-\tunsigned\tseq, next_seq, m_seq, r_seq;\n-\tint\t\tlast_type;\n-\tunsigned\tdepth;\n-\tint\t\ttotal_link_count;\n+\tstruct path\t\tpath;\n+\tstruct qstr\t\tlast;\n+\tstruct path\t\troot;\n+\tstruct inode\t\t*inode; /* path.dentry.d_inode */\n+\tunsigned int\t\tflags, state;\n+\tunsigned\t\tseq, next_seq, m_seq, r_seq;\n+\tenum component_type\tlast_type;\n+\tunsigned\t\tdepth;\n+\tint\t\t\ttotal_link_count;\n \tstruct saved {\n \t\tstruct path link;\n \t\tstruct delayed_call done;\n@@ -2221,7 +2221,7 @@ static struct dentry *follow_dotdot(struct nameidata *nd)\n \treturn dget(nd->path.dentry);\n }\n \n-static const char *handle_dots(struct nameidata *nd, int type)\n+static const char *handle_dots(struct nameidata *nd, enum component_type type)\n {\n \tif (type == LAST_DOTDOT) {\n \t\tconst char *error = NULL;\n@@ -2869,7 +2869,7 @@ static int path_parentat(struct nameidata *nd, unsigned flags,\n /* Note: this does not consume \"name\" */\n static int __filename_parentat(int dfd, struct filename *name,\n \t\t\t unsigned int flags, struct path *parent,\n-\t\t\t struct qstr *last, int *type,\n+\t\t\t struct qstr *last, enum component_type *type,\n \t\t\t const struct path *root)\n {\n \tint retval;\n@@ -2894,7 +2894,7 @@ static int __filename_parentat(int dfd, struct filename *name,\n \n static int filename_parentat(int dfd, struct filename *name,\n \t\t\t unsigned int flags, struct path *parent,\n-\t\t\t struct qstr *last, int *type)\n+\t\t\t struct qstr *last, enum component_type *type)\n {\n \treturn __filename_parentat(dfd, name, flags, parent, last, type, NULL);\n }\n@@ -2963,7 +2963,8 @@ static struct dentry *__start_removing_path(int dfd, struct filename *name,\n \tstruct path parent_path __free(path_put) = {};\n \tstruct dentry *d;\n \tstruct qstr last;\n-\tint type, error;\n+\tenum component_type type;\n+\tint error;\n \n \terror = filename_parentat(dfd, name, 0, &parent_path, &last, &type);\n \tif (error)\n@@ -3009,7 +3010,8 @@ struct dentry *kern_path_parent(const char *name, struct path *path)\n \tCLASS(filename_kernel, filename)(name);\n \tstruct dentry *d;\n \tstruct qstr last;\n-\tint type, error;\n+\tenum component_type type;\n+\tint error;\n \n \terror = filename_parentat(AT_FDCWD, filename, 0, &parent_path, &last, &type);\n \tif (error)\n@@ -3057,7 +3059,7 @@ EXPORT_SYMBOL(kern_path);\n * @root: pointer to struct path of the base directory\n */\n int vfs_path_parent_lookup(struct filename *filename, unsigned int flags,\n-\t\t\t struct path *parent, struct qstr *last, int *type,\n+\t\t\t struct path *parent, struct qstr *last, enum component_type *type,\n \t\t\t const struct path *root)\n {\n \treturn __filename_parentat(AT_FDCWD, filename, flags, parent, last,\n@@ -4903,7 +4905,7 @@ static struct dentry *filename_create(int dfd, struct filename *name,\n \tbool want_dir = lookup_flags & LOOKUP_DIRECTORY;\n \tunsigned int reval_flag = lookup_flags & LOOKUP_REVAL;\n \tunsigned int create_flags = LOOKUP_CREATE | LOOKUP_EXCL;\n-\tint type;\n+\tenum component_type type;\n \tint error;\n \n \terror = filename_parentat(dfd, name, reval_flag, path, &last, &type);\n@@ -5365,7 +5367,7 @@ int filename_rmdir(int dfd, struct filename *name)\n \tstruct dentry *dentry;\n \tstruct path path;\n \tstruct qstr last;\n-\tint type;\n+\tenum component_type type;\n \tunsigned int lookup_flags = 0;\n \tstruct delegated_inode delegated_inode = { };\n retry:\n@@ -5383,6 +5385,7 @@ int filename_rmdir(int dfd, struct filename *name)\n \tcase LAST_ROOT:\n \t\terror = -EBUSY;\n \t\tgoto exit2;\n+\tcase LAST_NORM: ; // OK\n \t}\n \n \terror = mnt_want_write(path.mnt);\n@@ -5507,7 +5510,7 @@ int filename_unlinkat(int dfd, struct filename *name)\n \tstruct dentry *dentry;\n \tstruct path path;\n \tstruct qstr last;\n-\tint type;\n+\tenum component_type type;\n \tstruct inode *inode;\n \tstruct delegated_inode delegated_inode = { };\n \tunsigned int lookup_flags = 0;\n@@ -6074,7 +6077,7 @@ int filename_renameat2(int olddfd, struct filename *from,\n \tstruct renamedata rd;\n \tstruct path old_path, new_path;\n \tstruct qstr old_last, new_last;\n-\tint old_type, new_type;\n+\tenum component_type old_type, new_type;\n \tstruct delegated_inode delegated_inode = { };\n \tunsigned int lookup_flags = 0;\n \tbool should_retry = false;\ndiff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c\nindex d08973b288e5..b12d481f5ba9 100644\n--- a/fs/smb/server/vfs.c\n+++ b/fs/smb/server/vfs.c\n@@ -56,7 +56,8 @@ static int ksmbd_vfs_path_lookup(struct ksmbd_share_config *share_conf,\n {\n \tstruct qstr last;\n \tconst struct path *root_share_path = &share_conf->vfs_path;\n-\tint err, type;\n+\tint err;\n+\tenum component_type type;\n \tstruct dentry *d;\n \n \tif (pathname[0] == '\\0') {\n@@ -668,7 +669,7 @@ int ksmbd_vfs_rename(struct ksmbd_work *work, const struct path *old_path,\n \tstruct renamedata rd;\n \tstruct ksmbd_share_config *share_conf = work->tcon->share_conf;\n \tstruct ksmbd_file *parent_fp;\n-\tint new_type;\n+\tenum component_type new_type;\n \tint err, lookup_flags = LOOKUP_NO_SYMLINKS;\n \n \tif (ksmbd_override_fsids(work))\ndiff --git a/include/linux/namei.h b/include/linux/namei.h\nindex 58600cf234bc..fa3ae87762b7 100644\n--- a/include/linux/namei.h\n+++ b/include/linux/namei.h\n@@ -16,7 +16,7 @@ enum { MAX_NESTED_LINKS = 8 };\n /*\n * Type of the last component on LOOKUP_PARENT\n */\n-enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT};\n+enum component_type {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT};\n \n /* pathwalk mode */\n #define LOOKUP_FOLLOW\t\tBIT(0)\t/* follow links at the end */\n@@ -70,7 +70,7 @@ static inline void end_removing_path(const struct path *path , struct dentry *de\n \tend_creating_path(path, dentry);\n }\n int vfs_path_parent_lookup(struct filename *filename, unsigned int flags,\n-\t\t\t struct path *parent, struct qstr *last, int *type,\n+\t\t\t struct path *parent, struct qstr *last, enum component_type *type,\n \t\t\t const struct path *root);\n int vfs_path_lookup(struct dentry *, struct vfsmount *, const char *,\n \t\t unsigned int, struct path *);\n", "prefixes": [ "v2" ] }