]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ksmbd: don't open-code %pD
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 31 Jan 2022 02:11:02 +0000 (21:11 -0500)
committerSteve French <stfrench@microsoft.com>
Wed, 5 Oct 2022 06:15:37 +0000 (01:15 -0500)
a bunch of places used %pd with file->f_path.dentry; shorter (and saner)
way to spell that is %pD with file...

Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c
fs/ksmbd/vfs.c

index 0f3fae17268b2900f29770beb876c5ec0bd5ac8f..e1c12ef4ab7b56a6333cd94e9b7139073faedcb5 100644 (file)
@@ -3894,8 +3894,7 @@ int smb2_query_dir(struct ksmbd_work *work)
            inode_permission(file_mnt_user_ns(dir_fp->filp),
                             file_inode(dir_fp->filp),
                             MAY_READ | MAY_EXEC)) {
-               pr_err("no right to enumerate directory (%pd)\n",
-                      dir_fp->filp->f_path.dentry);
+               pr_err("no right to enumerate directory (%pD)\n", dir_fp->filp);
                rc = -EACCES;
                goto err_out2;
        }
@@ -6266,8 +6265,8 @@ int smb2_read(struct ksmbd_work *work)
                goto out;
        }
 
-       ksmbd_debug(SMB, "filename %pd, offset %lld, len %zu\n",
-                   fp->filp->f_path.dentry, offset, length);
+       ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
+                   fp->filp, offset, length);
 
        work->aux_payload_buf = kvmalloc(length, GFP_KERNEL | __GFP_ZERO);
        if (!work->aux_payload_buf) {
@@ -6531,8 +6530,8 @@ int smb2_write(struct ksmbd_work *work)
                data_buf = (char *)(((char *)&req->hdr.ProtocolId) +
                                    le16_to_cpu(req->DataOffset));
 
-               ksmbd_debug(SMB, "filename %pd, offset %lld, len %zu\n",
-                           fp->filp->f_path.dentry, offset, length);
+               ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
+                           fp->filp, offset, length);
                err = ksmbd_vfs_write(work, fp, data_buf, length, &offset,
                                      writethrough, &nbytes);
                if (err < 0)
index 78d01033604c6b469f88f1fab62921732c81e6e2..0c04a59cbe60596d846bf378fe23f8d648894ea9 100644 (file)
@@ -377,8 +377,7 @@ int ksmbd_vfs_read(struct ksmbd_work *work, struct ksmbd_file *fp, size_t count,
 
        if (work->conn->connection_type) {
                if (!(fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
-                       pr_err("no right to read(%pd)\n",
-                              fp->filp->f_path.dentry);
+                       pr_err("no right to read(%pD)\n", fp->filp);
                        return -EACCES;
                }
        }
@@ -487,8 +486,7 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
 
        if (work->conn->connection_type) {
                if (!(fp->daccess & FILE_WRITE_DATA_LE)) {
-                       pr_err("no right to write(%pd)\n",
-                              fp->filp->f_path.dentry);
+                       pr_err("no right to write(%pD)\n", fp->filp);
                        err = -EACCES;
                        goto out;
                }
@@ -527,8 +525,8 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
        if (sync) {
                err = vfs_fsync_range(filp, offset, offset + *written, 0);
                if (err < 0)
-                       pr_err("fsync failed for filename = %pd, err = %d\n",
-                              fp->filp->f_path.dentry, err);
+                       pr_err("fsync failed for filename = %pD, err = %d\n",
+                              fp->filp, err);
        }
 
 out:
@@ -1743,11 +1741,11 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work,
        *total_size_written = 0;
 
        if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
-               pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
+               pr_err("no right to read(%pD)\n", src_fp->filp);
                return -EACCES;
        }
        if (!(dst_fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE))) {
-               pr_err("no right to write(%pd)\n", dst_fp->filp->f_path.dentry);
+               pr_err("no right to write(%pD)\n", dst_fp->filp);
                return -EACCES;
        }