Commit a6eb2d14 authored by Konstantin Artyushkin's avatar Konstantin Artyushkin

fix build for CentOS 7 with 3.10.0-514.* kernel

parent 1e96e38f
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* along with this library; if not, write to the Free Software * along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <generated/uapi/linux/version.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -3939,12 +3940,14 @@ cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb) ...@@ -3939,12 +3940,14 @@ cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb)
return tlink_tcon(cifs_sb_master_tlink(cifs_sb)); return tlink_tcon(cifs_sb_master_tlink(cifs_sb));
} }
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) < 1795)
static int static int
cifs_sb_tcon_pending_wait(void *unused) cifs_sb_tcon_pending_wait(void *unused)
{ {
schedule(); schedule();
return signal_pending(current) ? -ERESTARTSYS : 0; return signal_pending(current) ? -ERESTARTSYS : 0;
} }
#endif
/* find and return a tlink with given uid */ /* find and return a tlink with given uid */
static struct tcon_link * static struct tcon_link *
...@@ -4043,9 +4046,13 @@ cifs_sb_tlink(struct cifs_sb_info *cifs_sb) ...@@ -4043,9 +4046,13 @@ cifs_sb_tlink(struct cifs_sb_info *cifs_sb)
spin_unlock(&cifs_sb->tlink_tree_lock); spin_unlock(&cifs_sb->tlink_tree_lock);
} else { } else {
wait_for_construction: wait_for_construction:
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) >= 1795)
ret = wait_on_bit(&tlink->tl_flags, TCON_LINK_PENDING, TASK_INTERRUPTIBLE);
#else
ret = wait_on_bit(&tlink->tl_flags, TCON_LINK_PENDING, ret = wait_on_bit(&tlink->tl_flags, TCON_LINK_PENDING,
cifs_sb_tcon_pending_wait, cifs_sb_tcon_pending_wait,
TASK_INTERRUPTIBLE); TASK_INTERRUPTIBLE);
#endif
if (ret) { if (ret) {
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
return ERR_PTR(ret); return ERR_PTR(ret);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* along with this library; if not, write to the Free Software * along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <generated/uapi/linux/version.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/stat.h> #include <linux/stat.h>
...@@ -3679,12 +3680,14 @@ static int cifs_launder_page(struct page *page) ...@@ -3679,12 +3680,14 @@ static int cifs_launder_page(struct page *page)
return rc; return rc;
} }
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) < 1795)
static int static int
cifs_pending_writers_wait(void *unused) cifs_pending_writers_wait(void *unused)
{ {
schedule(); schedule();
return 0; return 0;
} }
#endif
void cifs_oplock_break(struct work_struct *work) void cifs_oplock_break(struct work_struct *work)
{ {
...@@ -3696,9 +3699,12 @@ void cifs_oplock_break(struct work_struct *work) ...@@ -3696,9 +3699,12 @@ void cifs_oplock_break(struct work_struct *work)
struct TCP_Server_Info *server = tcon->ses->server; struct TCP_Server_Info *server = tcon->ses->server;
int rc = 0; int rc = 0;
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) >= 1795)
wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS, TASK_UNINTERRUPTIBLE);
#else
wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS, wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_WRITERS,
cifs_pending_writers_wait, TASK_UNINTERRUPTIBLE); cifs_pending_writers_wait, TASK_UNINTERRUPTIBLE);
#endif
server->ops->downgrade_oplock(server, cinode, server->ops->downgrade_oplock(server, cinode,
test_bit(CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2, &cinode->flags)); test_bit(CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2, &cinode->flags));
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* along with this library; if not, write to the Free Software * along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <generated/uapi/linux/version.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -1791,6 +1792,7 @@ cifs_invalidate_mapping(struct inode *inode) ...@@ -1791,6 +1792,7 @@ cifs_invalidate_mapping(struct inode *inode)
return rc; return rc;
} }
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) < 1795)
/** /**
* cifs_wait_bit_killable - helper for functions that are sleeping on bit locks * cifs_wait_bit_killable - helper for functions that are sleeping on bit locks
* @word: long word containing the bit lock * @word: long word containing the bit lock
...@@ -1803,6 +1805,7 @@ cifs_wait_bit_killable(void *word) ...@@ -1803,6 +1805,7 @@ cifs_wait_bit_killable(void *word)
freezable_schedule_unsafe(); freezable_schedule_unsafe();
return 0; return 0;
} }
#endif
int int
cifs_revalidate_mapping(struct inode *inode) cifs_revalidate_mapping(struct inode *inode)
...@@ -1810,8 +1813,12 @@ cifs_revalidate_mapping(struct inode *inode) ...@@ -1810,8 +1813,12 @@ cifs_revalidate_mapping(struct inode *inode)
int rc; int rc;
unsigned long *flags = &CIFS_I(inode)->flags; unsigned long *flags = &CIFS_I(inode)->flags;
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) >= 1795)
rc = wait_on_bit_lock(flags, CIFS_INO_LOCK, TASK_KILLABLE);
#else
rc = wait_on_bit_lock(flags, CIFS_INO_LOCK, cifs_wait_bit_killable, rc = wait_on_bit_lock(flags, CIFS_INO_LOCK, cifs_wait_bit_killable,
TASK_KILLABLE); TASK_KILLABLE);
#endif
if (rc) if (rc)
return rc; return rc;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <generated/uapi/linux/version.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/mempool.h> #include <linux/mempool.h>
...@@ -565,12 +566,14 @@ void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock) ...@@ -565,12 +566,14 @@ void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock)
cinode->oplock = 0; cinode->oplock = 0;
} }
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) < 1795)
static int static int
cifs_oplock_break_wait(void *unused) cifs_oplock_break_wait(void *unused)
{ {
schedule(); schedule();
return signal_pending(current) ? -ERESTARTSYS : 0; return signal_pending(current) ? -ERESTARTSYS : 0;
} }
#endif
/* /*
* We wait for oplock breaks to be processed before we attempt to perform * We wait for oplock breaks to be processed before we attempt to perform
...@@ -581,8 +584,12 @@ int cifs_get_writer(struct cifsInodeInfo *cinode) ...@@ -581,8 +584,12 @@ int cifs_get_writer(struct cifsInodeInfo *cinode)
int rc; int rc;
start: start:
#if (RHEL_RELEASE_VERSION(RHEL_MAJOR,RHEL_MINOR) >= 1795)
rc = wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_OPLOCK_BREAK, TASK_KILLABLE);
#else
rc = wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_OPLOCK_BREAK, rc = wait_on_bit(&cinode->flags, CIFS_INODE_PENDING_OPLOCK_BREAK,
cifs_oplock_break_wait, TASK_KILLABLE); cifs_oplock_break_wait, TASK_KILLABLE);
#endif
if (rc) if (rc)
return rc; return rc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment