Commit 3102f3d2 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] fs/locks.c: remove MSNFS define

This patch removes the MSNFS defines.  These locks have a wider purpose
than emulating Microsoft NFS semantics.
parent 7962ad19
#define MSNFS /* HACK HACK */
/* /*
* linux/fs/locks.c * linux/fs/locks.c
* *
...@@ -576,10 +575,8 @@ static int flock_locks_conflict(struct file_lock *caller_fl, struct file_lock *s ...@@ -576,10 +575,8 @@ static int flock_locks_conflict(struct file_lock *caller_fl, struct file_lock *s
*/ */
if (!IS_FLOCK(sys_fl) || (caller_fl->fl_file == sys_fl->fl_file)) if (!IS_FLOCK(sys_fl) || (caller_fl->fl_file == sys_fl->fl_file))
return (0); return (0);
#ifdef MSNFS
if ((caller_fl->fl_type & LOCK_MAND) || (sys_fl->fl_type & LOCK_MAND)) if ((caller_fl->fl_type & LOCK_MAND) || (sys_fl->fl_type & LOCK_MAND))
return 0; return 0;
#endif
return (locks_conflict(caller_fl, sys_fl)); return (locks_conflict(caller_fl, sys_fl));
} }
...@@ -1029,10 +1026,8 @@ int posix_lock_file(struct file *filp, struct file_lock *caller, ...@@ -1029,10 +1026,8 @@ int posix_lock_file(struct file *filp, struct file_lock *caller,
} }
static inline int flock_translate_cmd(int cmd) { static inline int flock_translate_cmd(int cmd) {
#ifdef MSNFS
if (cmd & LOCK_MAND) if (cmd & LOCK_MAND)
return cmd & (LOCK_MAND | LOCK_RW); return cmd & (LOCK_MAND | LOCK_RW);
#endif
switch (cmd &~ LOCK_NB) { switch (cmd &~ LOCK_NB) {
case LOCK_SH: case LOCK_SH:
return F_RDLCK; return F_RDLCK;
...@@ -1325,11 +1320,7 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd) ...@@ -1325,11 +1320,7 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
type = error; type = error;
error = -EBADF; error = -EBADF;
if ((type != F_UNLCK) if ((type != F_UNLCK) && !(type & LOCK_MAND) && !(filp->f_mode & 3))
#ifdef MSNFS
&& !(type & LOCK_MAND)
#endif
&& !(filp->f_mode & 3))
goto out_putf; goto out_putf;
lock_kernel(); lock_kernel();
...@@ -1718,27 +1709,25 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx) ...@@ -1718,27 +1709,25 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
(inode->i_mode & (S_IXGRP | S_ISGID)) == S_ISGID) ? (inode->i_mode & (S_IXGRP | S_ISGID)) == S_ISGID) ?
"MANDATORY" : "ADVISORY "); "MANDATORY" : "ADVISORY ");
} else if (IS_FLOCK(fl)) { } else if (IS_FLOCK(fl)) {
#ifdef MSNFS
if (fl->fl_type & LOCK_MAND) { if (fl->fl_type & LOCK_MAND) {
out += sprintf(out, "FLOCK MSNFS "); out += sprintf(out, "FLOCK MSNFS ");
} else } else {
#endif
out += sprintf(out, "FLOCK ADVISORY "); out += sprintf(out, "FLOCK ADVISORY ");
}
} else if (IS_LEASE(fl)) { } else if (IS_LEASE(fl)) {
out += sprintf(out, "LEASE MANDATORY "); out += sprintf(out, "LEASE MANDATORY ");
} else { } else {
out += sprintf(out, "UNKNOWN UNKNOWN "); out += sprintf(out, "UNKNOWN UNKNOWN ");
} }
#ifdef MSNFS
if (fl->fl_type & LOCK_MAND) { if (fl->fl_type & LOCK_MAND) {
out += sprintf(out, "%s ", out += sprintf(out, "%s ",
(fl->fl_type & LOCK_READ) (fl->fl_type & LOCK_READ)
? (fl->fl_type & LOCK_WRITE) ? "RW " : "READ " ? (fl->fl_type & LOCK_WRITE) ? "RW " : "READ "
: (fl->fl_type & LOCK_WRITE) ? "WRITE" : "NONE "); : (fl->fl_type & LOCK_WRITE) ? "WRITE" : "NONE ");
} else } else {
#endif
out += sprintf(out, "%s ", out += sprintf(out, "%s ",
(fl->fl_type & F_WRLCK) ? "WRITE" : "READ "); (fl->fl_type & F_WRLCK) ? "WRITE" : "READ ");
}
out += sprintf(out, "%d %s:%ld ", out += sprintf(out, "%d %s:%ld ",
fl->fl_pid, fl->fl_pid,
inode ? kdevname(inode->i_dev) : "<none>", inode ? kdevname(inode->i_dev) : "<none>",
...@@ -1818,7 +1807,6 @@ int get_locks_status(char *buffer, char **start, off_t offset, int length) ...@@ -1818,7 +1807,6 @@ int get_locks_status(char *buffer, char **start, off_t offset, int length)
return length; return length;
} }
#ifdef MSNFS
/** /**
* lock_may_read - checks that the region is free of locks * lock_may_read - checks that the region is free of locks
* @inode: the inode that is being read * @inode: the inode that is being read
...@@ -1892,7 +1880,6 @@ int lock_may_write(struct inode *inode, loff_t start, unsigned long len) ...@@ -1892,7 +1880,6 @@ int lock_may_write(struct inode *inode, loff_t start, unsigned long len)
unlock_kernel(); unlock_kernel();
return result; return result;
} }
#endif
static int __init filelock_init(void) static int __init filelock_init(void)
{ {
......
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