aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ncpfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ncpfs')
-rw-r--r--fs/ncpfs/dir.c48
-rw-r--r--fs/ncpfs/inode.c6
-rw-r--r--fs/ncpfs/ioctl.c8
-rw-r--r--fs/ncpfs/ncplib_kernel.c2
-rw-r--r--fs/ncpfs/symlink.c2
5 files changed, 33 insertions, 33 deletions
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index e7ca827d7694..80021c709af9 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -127,7 +127,7 @@ static inline int ncp_case_sensitive(const struct inode *i)
127static int 127static int
128ncp_hash_dentry(const struct dentry *dentry, struct qstr *this) 128ncp_hash_dentry(const struct dentry *dentry, struct qstr *this)
129{ 129{
130 struct inode *inode = ACCESS_ONCE(dentry->d_inode); 130 struct inode *inode = d_inode_rcu(dentry);
131 131
132 if (!inode) 132 if (!inode)
133 return 0; 133 return 0;
@@ -162,7 +162,7 @@ ncp_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
162 if (len != name->len) 162 if (len != name->len)
163 return 1; 163 return 1;
164 164
165 pinode = ACCESS_ONCE(parent->d_inode); 165 pinode = d_inode_rcu(parent);
166 if (!pinode) 166 if (!pinode)
167 return 1; 167 return 1;
168 168
@@ -180,7 +180,7 @@ ncp_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
180static int 180static int
181ncp_delete_dentry(const struct dentry * dentry) 181ncp_delete_dentry(const struct dentry * dentry)
182{ 182{
183 struct inode *inode = dentry->d_inode; 183 struct inode *inode = d_inode(dentry);
184 184
185 if (inode) { 185 if (inode) {
186 if (is_bad_inode(inode)) 186 if (is_bad_inode(inode))
@@ -224,7 +224,7 @@ ncp_force_unlink(struct inode *dir, struct dentry* dentry)
224 memset(&info, 0, sizeof(info)); 224 memset(&info, 0, sizeof(info));
225 225
226 /* remove the Read-Only flag on the NW server */ 226 /* remove the Read-Only flag on the NW server */
227 inode = dentry->d_inode; 227 inode = d_inode(dentry);
228 228
229 old_nwattr = NCP_FINFO(inode)->nwattr; 229 old_nwattr = NCP_FINFO(inode)->nwattr;
230 info.attributes = old_nwattr & ~(aRONLY|aDELETEINHIBIT|aRENAMEINHIBIT); 230 info.attributes = old_nwattr & ~(aRONLY|aDELETEINHIBIT|aRENAMEINHIBIT);
@@ -254,7 +254,7 @@ ncp_force_rename(struct inode *old_dir, struct dentry* old_dentry, char *_old_na
254{ 254{
255 struct nw_modify_dos_info info; 255 struct nw_modify_dos_info info;
256 int res=0x90,res2; 256 int res=0x90,res2;
257 struct inode *old_inode = old_dentry->d_inode; 257 struct inode *old_inode = d_inode(old_dentry);
258 __le32 old_nwattr = NCP_FINFO(old_inode)->nwattr; 258 __le32 old_nwattr = NCP_FINFO(old_inode)->nwattr;
259 __le32 new_nwattr = 0; /* shut compiler warning */ 259 __le32 new_nwattr = 0; /* shut compiler warning */
260 int old_nwattr_changed = 0; 260 int old_nwattr_changed = 0;
@@ -268,8 +268,8 @@ ncp_force_rename(struct inode *old_dir, struct dentry* old_dentry, char *_old_na
268 res2 = ncp_modify_file_or_subdir_dos_info_path(NCP_SERVER(old_inode), old_inode, NULL, DM_ATTRIBUTES, &info); 268 res2 = ncp_modify_file_or_subdir_dos_info_path(NCP_SERVER(old_inode), old_inode, NULL, DM_ATTRIBUTES, &info);
269 if (!res2) 269 if (!res2)
270 old_nwattr_changed = 1; 270 old_nwattr_changed = 1;
271 if (new_dentry && new_dentry->d_inode) { 271 if (new_dentry && d_really_is_positive(new_dentry)) {
272 new_nwattr = NCP_FINFO(new_dentry->d_inode)->nwattr; 272 new_nwattr = NCP_FINFO(d_inode(new_dentry))->nwattr;
273 info.attributes = new_nwattr & ~(aRONLY|aRENAMEINHIBIT|aDELETEINHIBIT); 273 info.attributes = new_nwattr & ~(aRONLY|aRENAMEINHIBIT|aDELETEINHIBIT);
274 res2 = ncp_modify_file_or_subdir_dos_info_path(NCP_SERVER(new_dir), new_dir, _new_name, DM_ATTRIBUTES, &info); 274 res2 = ncp_modify_file_or_subdir_dos_info_path(NCP_SERVER(new_dir), new_dir, _new_name, DM_ATTRIBUTES, &info);
275 if (!res2) 275 if (!res2)
@@ -324,9 +324,9 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags)
324 return -ECHILD; 324 return -ECHILD;
325 325
326 parent = dget_parent(dentry); 326 parent = dget_parent(dentry);
327 dir = parent->d_inode; 327 dir = d_inode(parent);
328 328
329 if (!dentry->d_inode) 329 if (d_really_is_negative(dentry))
330 goto finished; 330 goto finished;
331 331
332 server = NCP_SERVER(dir); 332 server = NCP_SERVER(dir);
@@ -367,7 +367,7 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags)
367 * what we remember, it's not valid any more. 367 * what we remember, it's not valid any more.
368 */ 368 */
369 if (!res) { 369 if (!res) {
370 struct inode *inode = dentry->d_inode; 370 struct inode *inode = d_inode(dentry);
371 371
372 mutex_lock(&inode->i_mutex); 372 mutex_lock(&inode->i_mutex);
373 if (finfo.i.dirEntNum == NCP_FINFO(inode)->dirEntNum) { 373 if (finfo.i.dirEntNum == NCP_FINFO(inode)->dirEntNum) {
@@ -388,7 +388,7 @@ finished:
388 388
389static time_t ncp_obtain_mtime(struct dentry *dentry) 389static time_t ncp_obtain_mtime(struct dentry *dentry)
390{ 390{
391 struct inode *inode = dentry->d_inode; 391 struct inode *inode = d_inode(dentry);
392 struct ncp_server *server = NCP_SERVER(inode); 392 struct ncp_server *server = NCP_SERVER(inode);
393 struct nw_info_struct i; 393 struct nw_info_struct i;
394 394
@@ -404,7 +404,7 @@ static time_t ncp_obtain_mtime(struct dentry *dentry)
404static inline void 404static inline void
405ncp_invalidate_dircache_entries(struct dentry *parent) 405ncp_invalidate_dircache_entries(struct dentry *parent)
406{ 406{
407 struct ncp_server *server = NCP_SERVER(parent->d_inode); 407 struct ncp_server *server = NCP_SERVER(d_inode(parent));
408 struct dentry *dentry; 408 struct dentry *dentry;
409 409
410 spin_lock(&parent->d_lock); 410 spin_lock(&parent->d_lock);
@@ -418,7 +418,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent)
418static int ncp_readdir(struct file *file, struct dir_context *ctx) 418static int ncp_readdir(struct file *file, struct dir_context *ctx)
419{ 419{
420 struct dentry *dentry = file->f_path.dentry; 420 struct dentry *dentry = file->f_path.dentry;
421 struct inode *inode = dentry->d_inode; 421 struct inode *inode = d_inode(dentry);
422 struct page *page = NULL; 422 struct page *page = NULL;
423 struct ncp_server *server = NCP_SERVER(inode); 423 struct ncp_server *server = NCP_SERVER(inode);
424 union ncp_dir_cache *cache = NULL; 424 union ncp_dir_cache *cache = NULL;
@@ -491,13 +491,13 @@ static int ncp_readdir(struct file *file, struct dir_context *ctx)
491 goto invalid_cache; 491 goto invalid_cache;
492 } 492 }
493 spin_unlock(&dentry->d_lock); 493 spin_unlock(&dentry->d_lock);
494 if (!dent->d_inode) { 494 if (d_really_is_negative(dent)) {
495 dput(dent); 495 dput(dent);
496 goto invalid_cache; 496 goto invalid_cache;
497 } 497 }
498 over = !dir_emit(ctx, dent->d_name.name, 498 over = !dir_emit(ctx, dent->d_name.name,
499 dent->d_name.len, 499 dent->d_name.len,
500 dent->d_inode->i_ino, DT_UNKNOWN); 500 d_inode(dent)->i_ino, DT_UNKNOWN);
501 dput(dent); 501 dput(dent);
502 if (over) 502 if (over)
503 goto finished; 503 goto finished;
@@ -571,7 +571,7 @@ static void ncp_d_prune(struct dentry *dentry)
571{ 571{
572 if (!dentry->d_fsdata) /* not referenced from page cache */ 572 if (!dentry->d_fsdata) /* not referenced from page cache */
573 return; 573 return;
574 NCP_FINFO(dentry->d_parent->d_inode)->flags &= ~NCPI_DIR_CACHE; 574 NCP_FINFO(d_inode(dentry->d_parent))->flags &= ~NCPI_DIR_CACHE;
575} 575}
576 576
577static int 577static int
@@ -580,7 +580,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
580 int inval_childs) 580 int inval_childs)
581{ 581{
582 struct dentry *newdent, *dentry = file->f_path.dentry; 582 struct dentry *newdent, *dentry = file->f_path.dentry;
583 struct inode *dir = dentry->d_inode; 583 struct inode *dir = d_inode(dentry);
584 struct ncp_cache_control ctl = *ctrl; 584 struct ncp_cache_control ctl = *ctrl;
585 struct qstr qname; 585 struct qstr qname;
586 int valid = 0; 586 int valid = 0;
@@ -621,7 +621,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
621 dentry_update_name_case(newdent, &qname); 621 dentry_update_name_case(newdent, &qname);
622 } 622 }
623 623
624 if (!newdent->d_inode) { 624 if (d_really_is_negative(newdent)) {
625 struct inode *inode; 625 struct inode *inode;
626 626
627 entry->opened = 0; 627 entry->opened = 0;
@@ -637,7 +637,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
637 spin_unlock(&dentry->d_lock); 637 spin_unlock(&dentry->d_lock);
638 } 638 }
639 } else { 639 } else {
640 struct inode *inode = newdent->d_inode; 640 struct inode *inode = d_inode(newdent);
641 641
642 mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD); 642 mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD);
643 ncp_update_inode2(inode, entry); 643 ncp_update_inode2(inode, entry);
@@ -659,10 +659,10 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
659 ctl.cache = kmap(ctl.page); 659 ctl.cache = kmap(ctl.page);
660 } 660 }
661 if (ctl.cache) { 661 if (ctl.cache) {
662 if (newdent->d_inode) { 662 if (d_really_is_positive(newdent)) {
663 newdent->d_fsdata = newdent; 663 newdent->d_fsdata = newdent;
664 ctl.cache->dentry[ctl.idx] = newdent; 664 ctl.cache->dentry[ctl.idx] = newdent;
665 ino = newdent->d_inode->i_ino; 665 ino = d_inode(newdent)->i_ino;
666 ncp_new_dentry(newdent); 666 ncp_new_dentry(newdent);
667 } 667 }
668 valid = 1; 668 valid = 1;
@@ -807,7 +807,7 @@ int ncp_conn_logged_in(struct super_block *sb)
807 } 807 }
808 dent = sb->s_root; 808 dent = sb->s_root;
809 if (dent) { 809 if (dent) {
810 struct inode* ino = dent->d_inode; 810 struct inode* ino = d_inode(dent);
811 if (ino) { 811 if (ino) {
812 ncp_update_known_namespace(server, volNumber, NULL); 812 ncp_update_known_namespace(server, volNumber, NULL);
813 NCP_FINFO(ino)->volNumber = volNumber; 813 NCP_FINFO(ino)->volNumber = volNumber;
@@ -815,7 +815,7 @@ int ncp_conn_logged_in(struct super_block *sb)
815 NCP_FINFO(ino)->DosDirNum = DosDirNum; 815 NCP_FINFO(ino)->DosDirNum = DosDirNum;
816 result = 0; 816 result = 0;
817 } else { 817 } else {
818 ncp_dbg(1, "sb->s_root->d_inode == NULL!\n"); 818 ncp_dbg(1, "d_inode(sb->s_root) == NULL!\n");
819 } 819 }
820 } else { 820 } else {
821 ncp_dbg(1, "sb->s_root == NULL!\n"); 821 ncp_dbg(1, "sb->s_root == NULL!\n");
@@ -1055,7 +1055,7 @@ out:
1055 1055
1056static int ncp_unlink(struct inode *dir, struct dentry *dentry) 1056static int ncp_unlink(struct inode *dir, struct dentry *dentry)
1057{ 1057{
1058 struct inode *inode = dentry->d_inode; 1058 struct inode *inode = d_inode(dentry);
1059 struct ncp_server *server; 1059 struct ncp_server *server;
1060 int error; 1060 int error;
1061 1061
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 01a9e16e9782..9605a2f63549 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -812,7 +812,7 @@ static int ncp_statfs(struct dentry *dentry, struct kstatfs *buf)
812 if (!d) { 812 if (!d) {
813 goto dflt; 813 goto dflt;
814 } 814 }
815 i = d->d_inode; 815 i = d_inode(d);
816 if (!i) { 816 if (!i) {
817 goto dflt; 817 goto dflt;
818 } 818 }
@@ -865,7 +865,7 @@ dflt:;
865 865
866int ncp_notify_change(struct dentry *dentry, struct iattr *attr) 866int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
867{ 867{
868 struct inode *inode = dentry->d_inode; 868 struct inode *inode = d_inode(dentry);
869 int result = 0; 869 int result = 0;
870 __le32 info_mask; 870 __le32 info_mask;
871 struct nw_modify_dos_info info; 871 struct nw_modify_dos_info info;
@@ -878,7 +878,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
878 goto out; 878 goto out;
879 879
880 result = -EPERM; 880 result = -EPERM;
881 if (IS_DEADDIR(dentry->d_inode)) 881 if (IS_DEADDIR(d_inode(dentry)))
882 goto out; 882 goto out;
883 883
884 /* ageing the dentry to force validation */ 884 /* ageing the dentry to force validation */
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index cf7e043a9447..79b113048eac 100644
--- a/fs/ncpfs/ioctl.c
+++ b/fs/ncpfs/ioctl.c
@@ -376,7 +376,7 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
376 struct dentry* dentry = inode->i_sb->s_root; 376 struct dentry* dentry = inode->i_sb->s_root;
377 377
378 if (dentry) { 378 if (dentry) {
379 struct inode* s_inode = dentry->d_inode; 379 struct inode* s_inode = d_inode(dentry);
380 380
381 if (s_inode) { 381 if (s_inode) {
382 sr.volNumber = NCP_FINFO(s_inode)->volNumber; 382 sr.volNumber = NCP_FINFO(s_inode)->volNumber;
@@ -384,7 +384,7 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
384 sr.namespace = server->name_space[sr.volNumber]; 384 sr.namespace = server->name_space[sr.volNumber];
385 result = 0; 385 result = 0;
386 } else 386 } else
387 ncp_dbg(1, "s_root->d_inode==NULL\n"); 387 ncp_dbg(1, "d_inode(s_root)==NULL\n");
388 } else 388 } else
389 ncp_dbg(1, "s_root==NULL\n"); 389 ncp_dbg(1, "s_root==NULL\n");
390 } else { 390 } else {
@@ -431,7 +431,7 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
431 if (result == 0) { 431 if (result == 0) {
432 dentry = inode->i_sb->s_root; 432 dentry = inode->i_sb->s_root;
433 if (dentry) { 433 if (dentry) {
434 struct inode* s_inode = dentry->d_inode; 434 struct inode* s_inode = d_inode(dentry);
435 435
436 if (s_inode) { 436 if (s_inode) {
437 NCP_FINFO(s_inode)->volNumber = vnum; 437 NCP_FINFO(s_inode)->volNumber = vnum;
@@ -439,7 +439,7 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
439 NCP_FINFO(s_inode)->DosDirNum = dosde; 439 NCP_FINFO(s_inode)->DosDirNum = dosde;
440 server->root_setuped = 1; 440 server->root_setuped = 1;
441 } else { 441 } else {
442 ncp_dbg(1, "s_root->d_inode==NULL\n"); 442 ncp_dbg(1, "d_inode(s_root)==NULL\n");
443 result = -EIO; 443 result = -EIO;
444 } 444 }
445 } else { 445 } else {
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c
index 2b502a0d7941..88dbbc9fcf4d 100644
--- a/fs/ncpfs/ncplib_kernel.c
+++ b/fs/ncpfs/ncplib_kernel.c
@@ -727,7 +727,7 @@ int
727ncp_del_file_or_subdir2(struct ncp_server *server, 727ncp_del_file_or_subdir2(struct ncp_server *server,
728 struct dentry *dentry) 728 struct dentry *dentry)
729{ 729{
730 struct inode *inode = dentry->d_inode; 730 struct inode *inode = d_inode(dentry);
731 __u8 volnum; 731 __u8 volnum;
732 __le32 dirent; 732 __le32 dirent;
733 733
diff --git a/fs/ncpfs/symlink.c b/fs/ncpfs/symlink.c
index 1a63bfdb4a65..421b6f91e8ec 100644
--- a/fs/ncpfs/symlink.c
+++ b/fs/ncpfs/symlink.c
@@ -156,7 +156,7 @@ int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) {
156 goto failfree; 156 goto failfree;
157 } 157 }
158 158
159 inode=dentry->d_inode; 159 inode=d_inode(dentry);
160 160
161 if (ncp_make_open(inode, O_WRONLY)) 161 if (ncp_make_open(inode, O_WRONLY))
162 goto failfree; 162 goto failfree;