Merge tag 'i3c/for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux
[linux-2.6-microblaze.git] / fs / cifs / file.c
index be46fab..6d00190 100644 (file)
@@ -44,6 +44,7 @@
 #include "cifs_fs_sb.h"
 #include "fscache.h"
 #include "smbdirect.h"
+#include "fs_context.h"
 
 static inline int cifs_convert_flags(unsigned int flags)
 {
@@ -416,6 +417,8 @@ static void cifsFileInfo_put_work(struct work_struct *work)
  * cifsFileInfo_put - release a reference of file priv data
  *
  * Always potentially wait for oplock handler. See _cifsFileInfo_put().
+ *
+ * @cifs_file: cifs/smb3 specific info (eg refcounts) for an open file
  */
 void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
 {
@@ -431,8 +434,11 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
  *
  * If @wait_for_oplock_handler is true and we are releasing the last
  * reference, wait for any running oplock break handler of the file
- * and cancel any pending one. If calling this function from the
- * oplock break handler, you need to pass false.
+ * and cancel any pending one.
+ *
+ * @cifs_file: cifs/smb3 specific info (eg refcounts) for an open file
+ * @wait_oplock_handler: must be false if called from oplock_break_handler
+ * @offload:   not offloaded on close and oplock breaks
  *
  */
 void _cifsFileInfo_put(struct cifsFileInfo *cifs_file,
@@ -566,7 +572,7 @@ int cifs_open(struct inode *inode, struct file *file)
                                le64_to_cpu(tcon->fsUnixInfo.Capability))) {
                /* can not refresh inode info since size could be stale */
                rc = cifs_posix_open(full_path, &inode, inode->i_sb,
-                               cifs_sb->mnt_file_mode /* ignored */,
+                               cifs_sb->ctx->file_mode /* ignored */,
                                file->f_flags, &oplock, &fid.netfid, xid);
                if (rc == 0) {
                        cifs_dbg(FYI, "posix open succeeded\n");
@@ -735,7 +741,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
                                                ~(O_CREAT | O_EXCL | O_TRUNC);
 
                rc = cifs_posix_open(full_path, NULL, inode->i_sb,
-                                    cifs_sb->mnt_file_mode /* ignored */,
+                                    cifs_sb->ctx->file_mode /* ignored */,
                                     oflags, &oplock, &cfile->fid.netfid, xid);
                if (rc == 0) {
                        cifs_dbg(FYI, "posix reopen succeeded\n");
@@ -2330,7 +2336,7 @@ static int cifs_writepages(struct address_space *mapping,
         * If wsize is smaller than the page cache size, default to writing
         * one page at a time via cifs_writepage
         */
-       if (cifs_sb->wsize < PAGE_SIZE)
+       if (cifs_sb->ctx->wsize < PAGE_SIZE)
                return generic_writepages(mapping, wbc);
 
        xid = get_xid();
@@ -2363,7 +2369,7 @@ retry:
                if (rc)
                        get_file_rc = rc;
 
-               rc = server->ops->wait_mtu_credits(server, cifs_sb->wsize,
+               rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->wsize,
                                                   &wsize, credits);
                if (rc != 0) {
                        done = true;
@@ -2905,7 +2911,7 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from,
                                break;
                }
 
-               rc = server->ops->wait_mtu_credits(server, cifs_sb->wsize,
+               rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->wsize,
                                                   &wsize, credits);
                if (rc)
                        break;
@@ -3636,7 +3642,7 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file,
                                break;
                }
 
-               rc = server->ops->wait_mtu_credits(server, cifs_sb->rsize,
+               rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->rsize,
                                                   &rsize, credits);
                if (rc)
                        break;
@@ -4022,7 +4028,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
        cifs_sb = CIFS_FILE_SB(file);
 
        /* FIXME: set up handlers for larger reads and/or convert to async */
-       rsize = min_t(unsigned int, cifs_sb->rsize, CIFSMaxBufSize);
+       rsize = min_t(unsigned int, cifs_sb->ctx->rsize, CIFSMaxBufSize);
 
        if (file->private_data == NULL) {
                rc = -EBADF;
@@ -4407,7 +4413,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
                                break;
                }
 
-               rc = server->ops->wait_mtu_credits(server, cifs_sb->rsize,
+               rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->rsize,
                                                   &rsize, credits);
                if (rc)
                        break;