smb2ops.c (46eeaa11bdd1bc9e077bdf741d32ca7235d263c6) smb2ops.c (6f17163b9339fac92023a1d9bef22128db3b9a4b)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * SMB2 version specific operations
4 *
5 * Copyright (c) 2012, Jeff Layton <jlayton@redhat.com>
6 */
7
8#include <linux/pagemap.h>

--- 1378 unchanged lines hidden (view full) ---

1387 cfile->fid.mid = fid->mid;
1388#endif /* CIFS_DEBUG2 */
1389 server->ops->set_oplock_level(cinode, oplock, fid->epoch,
1390 &fid->purge_cache);
1391 cinode->can_cache_brlcks = CIFS_CACHE_WRITE(cinode);
1392 memcpy(cfile->fid.create_guid, fid->create_guid, 16);
1393}
1394
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * SMB2 version specific operations
4 *
5 * Copyright (c) 2012, Jeff Layton <jlayton@redhat.com>
6 */
7
8#include <linux/pagemap.h>

--- 1378 unchanged lines hidden (view full) ---

1387 cfile->fid.mid = fid->mid;
1388#endif /* CIFS_DEBUG2 */
1389 server->ops->set_oplock_level(cinode, oplock, fid->epoch,
1390 &fid->purge_cache);
1391 cinode->can_cache_brlcks = CIFS_CACHE_WRITE(cinode);
1392 memcpy(cfile->fid.create_guid, fid->create_guid, 16);
1393}
1394
1395static void
1395static int
1396smb2_close_file(const unsigned int xid, struct cifs_tcon *tcon,
1397 struct cifs_fid *fid)
1398{
1396smb2_close_file(const unsigned int xid, struct cifs_tcon *tcon,
1397 struct cifs_fid *fid)
1398{
1399 SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
1399 return SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid);
1400}
1401
1400}
1401
1402static void
1402static int
1403smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
1404 struct cifsFileInfo *cfile)
1405{
1406 struct smb2_file_network_open_info file_inf;
1407 struct inode *inode;
1408 int rc;
1409
1410 rc = __SMB2_close(xid, tcon, cfile->fid.persistent_fid,
1411 cfile->fid.volatile_fid, &file_inf);
1412 if (rc)
1403smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon,
1404 struct cifsFileInfo *cfile)
1405{
1406 struct smb2_file_network_open_info file_inf;
1407 struct inode *inode;
1408 int rc;
1409
1410 rc = __SMB2_close(xid, tcon, cfile->fid.persistent_fid,
1411 cfile->fid.volatile_fid, &file_inf);
1412 if (rc)
1413 return;
1413 return rc;
1414
1415 inode = d_inode(cfile->dentry);
1416
1417 spin_lock(&inode->i_lock);
1418 CIFS_I(inode)->time = jiffies;
1419
1420 /* Creation time should not need to be updated on close */
1421 if (file_inf.LastWriteTime)

--- 12 unchanged lines hidden (view full) ---

1434 * calculating num blocks.
1435 */
1436 if (le64_to_cpu(file_inf.AllocationSize) > 4096)
1437 inode->i_blocks =
1438 (512 - 1 + le64_to_cpu(file_inf.AllocationSize)) >> 9;
1439
1440 /* End of file and Attributes should not have to be updated on close */
1441 spin_unlock(&inode->i_lock);
1414
1415 inode = d_inode(cfile->dentry);
1416
1417 spin_lock(&inode->i_lock);
1418 CIFS_I(inode)->time = jiffies;
1419
1420 /* Creation time should not need to be updated on close */
1421 if (file_inf.LastWriteTime)

--- 12 unchanged lines hidden (view full) ---

1434 * calculating num blocks.
1435 */
1436 if (le64_to_cpu(file_inf.AllocationSize) > 4096)
1437 inode->i_blocks =
1438 (512 - 1 + le64_to_cpu(file_inf.AllocationSize)) >> 9;
1439
1440 /* End of file and Attributes should not have to be updated on close */
1441 spin_unlock(&inode->i_lock);
1442 return rc;
1442}
1443
1444static int
1445SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon,
1446 u64 persistent_fid, u64 volatile_fid,
1447 struct copychunk_ioctl *pcchunk)
1448{
1449 int rc;

--- 4333 unchanged lines hidden ---
1443}
1444
1445static int
1446SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon,
1447 u64 persistent_fid, u64 volatile_fid,
1448 struct copychunk_ioctl *pcchunk)
1449{
1450 int rc;

--- 4333 unchanged lines hidden ---