diff options
author | Petr Vandrovec <petr@vandrovec.name> | 2010-09-27 01:47:33 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2010-10-04 21:10:52 +0200 |
commit | 2e54eb96e2c801f33d95b5dade15212ac4d6c4a5 (patch) | |
tree | c2996f29aa49881e93c7a37fad41e4961f6b8578 /fs/ncpfs/ncpsign_kernel.c | |
parent | 60056794127a25d641465b706e8828186f7a2e1f (diff) |
BKL: Remove BKL from ncpfs
Dozen of changes in ncpfs to provide some locking other than BKL.
In readdir cache unlock and mark complete first page as last operation,
so it can be used for synchronization, as code intended.
When updating dentry name on case insensitive filesystems do at least
some basic locking...
Hold i_mutex when updating inode fields.
Push some ncp_conn_is_valid down to ncp_request. Connection can become
invalid at any moment, and fewer error code paths to test the better.
Use i_size_{read,write} to modify file size.
Set inode's backing_dev_info as ncpfs has its own special bdi.
In ioctl unbreak ioctls invoked on filesystem mounted 'ro' - tests are
for inode writeable or owner match, but were turned to filesystem
writeable and inode writeable or owner match. Also collect all permission
checks in single place.
Add some locking, and remove comments saying that it would be cool to
add some locks to the code.
Constify some pointers.
Signed-off-by: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'fs/ncpfs/ncpsign_kernel.c')
-rw-r--r-- | fs/ncpfs/ncpsign_kernel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ncpfs/ncpsign_kernel.c b/fs/ncpfs/ncpsign_kernel.c index 7c0b5c21e6cf..d8b2d7e6910b 100644 --- a/fs/ncpfs/ncpsign_kernel.c +++ b/fs/ncpfs/ncpsign_kernel.c @@ -15,21 +15,21 @@ /* i386: 32-bit, little endian, handles mis-alignment */ #ifdef __i386__ -#define GET_LE32(p) (*(int *)(p)) +#define GET_LE32(p) (*(const int *)(p)) #define PUT_LE32(p,v) { *(int *)(p)=v; } #else /* from include/ncplib.h */ -#define BVAL(buf,pos) (((__u8 *)(buf))[pos]) +#define BVAL(buf,pos) (((const __u8 *)(buf))[pos]) #define PVAL(buf,pos) ((unsigned)BVAL(buf,pos)) -#define BSET(buf,pos,val) (BVAL(buf,pos) = (val)) +#define BSET(buf,pos,val) (((__u8 *)(buf))[pos] = (val)) static inline __u16 -WVAL_LH(__u8 * buf, int pos) +WVAL_LH(const __u8 * buf, int pos) { return PVAL(buf, pos) | PVAL(buf, pos + 1) << 8; } static inline __u32 -DVAL_LH(__u8 * buf, int pos) +DVAL_LH(const __u8 * buf, int pos) { return WVAL_LH(buf, pos) | WVAL_LH(buf, pos + 2) << 16; } |