@@ -1395,7 +1395,7 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
1395
1395
cifs_dbg (VFS , "Can't push all brlocks!\n" );
1396
1396
break ;
1397
1397
}
1398
- length = 1 + flock -> fl_end - flock -> fl_start ;
1398
+ length = cifs_flock_len ( flock ) ;
1399
1399
if (flock -> fl_type == F_RDLCK || flock -> fl_type == F_SHLCK )
1400
1400
type = CIFS_RDLCK ;
1401
1401
else
@@ -1511,7 +1511,7 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
1511
1511
bool wait_flag , bool posix_lck , unsigned int xid )
1512
1512
{
1513
1513
int rc = 0 ;
1514
- __u64 length = 1 + flock -> fl_end - flock -> fl_start ;
1514
+ __u64 length = cifs_flock_len ( flock ) ;
1515
1515
struct cifsFileInfo * cfile = (struct cifsFileInfo * )file -> private_data ;
1516
1516
struct cifs_tcon * tcon = tlink_tcon (cfile -> tlink );
1517
1517
struct TCP_Server_Info * server = tcon -> ses -> server ;
@@ -1609,7 +1609,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
1609
1609
struct cifs_tcon * tcon = tlink_tcon (cfile -> tlink );
1610
1610
struct cifsInodeInfo * cinode = CIFS_I (d_inode (cfile -> dentry ));
1611
1611
struct cifsLockInfo * li , * tmp ;
1612
- __u64 length = 1 + flock -> fl_end - flock -> fl_start ;
1612
+ __u64 length = cifs_flock_len ( flock ) ;
1613
1613
struct list_head tmp_llist ;
1614
1614
1615
1615
INIT_LIST_HEAD (& tmp_llist );
@@ -1713,7 +1713,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1713
1713
unsigned int xid )
1714
1714
{
1715
1715
int rc = 0 ;
1716
- __u64 length = 1 + flock -> fl_end - flock -> fl_start ;
1716
+ __u64 length = cifs_flock_len ( flock ) ;
1717
1717
struct cifsFileInfo * cfile = (struct cifsFileInfo * )file -> private_data ;
1718
1718
struct cifs_tcon * tcon = tlink_tcon (cfile -> tlink );
1719
1719
struct TCP_Server_Info * server = tcon -> ses -> server ;
0 commit comments