diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/lockd/svcsubs.c | 43 | ||||
-rw-r--r-- | fs/nfs/direct.c | 10 | ||||
-rw-r--r-- | fs/nfs/write.c | 12 |
3 files changed, 44 insertions, 21 deletions
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index de7536358c7c..62f4a385177f 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c | |||
@@ -30,6 +30,36 @@ | |||
30 | static struct nlm_file * nlm_files[FILE_NRHASH]; | 30 | static struct nlm_file * nlm_files[FILE_NRHASH]; |
31 | static DECLARE_MUTEX(nlm_file_sema); | 31 | static DECLARE_MUTEX(nlm_file_sema); |
32 | 32 | ||
33 | #ifdef NFSD_DEBUG | ||
34 | static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f) | ||
35 | { | ||
36 | u32 *fhp = (u32*)f->data; | ||
37 | |||
38 | /* print the first 32 bytes of the fh */ | ||
39 | dprintk("lockd: %s (%08x %08x %08x %08x %08x %08x %08x %08x)\n", | ||
40 | msg, fhp[0], fhp[1], fhp[2], fhp[3], | ||
41 | fhp[4], fhp[5], fhp[6], fhp[7]); | ||
42 | } | ||
43 | |||
44 | static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) | ||
45 | { | ||
46 | struct inode *inode = file->f_file->f_dentry->d_inode; | ||
47 | |||
48 | dprintk("lockd: %s %s/%ld\n", | ||
49 | msg, inode->i_sb->s_id, inode->i_ino); | ||
50 | } | ||
51 | #else | ||
52 | static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f) | ||
53 | { | ||
54 | return; | ||
55 | } | ||
56 | |||
57 | static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) | ||
58 | { | ||
59 | return; | ||
60 | } | ||
61 | #endif | ||
62 | |||
33 | static inline unsigned int file_hash(struct nfs_fh *f) | 63 | static inline unsigned int file_hash(struct nfs_fh *f) |
34 | { | 64 | { |
35 | unsigned int tmp=0; | 65 | unsigned int tmp=0; |
@@ -55,11 +85,8 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, | |||
55 | struct nlm_file *file; | 85 | struct nlm_file *file; |
56 | unsigned int hash; | 86 | unsigned int hash; |
57 | u32 nfserr; | 87 | u32 nfserr; |
58 | u32 *fhp = (u32*)f->data; | ||
59 | |||
60 | dprintk("lockd: nlm_file_lookup(%08x %08x %08x %08x %08x %08x)\n", | ||
61 | fhp[0], fhp[1], fhp[2], fhp[3], fhp[4], fhp[5]); | ||
62 | 88 | ||
89 | nlm_debug_print_fh("nlm_file_lookup", f); | ||
63 | 90 | ||
64 | hash = file_hash(f); | 91 | hash = file_hash(f); |
65 | 92 | ||
@@ -70,8 +97,7 @@ nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, | |||
70 | if (!nfs_compare_fh(&file->f_handle, f)) | 97 | if (!nfs_compare_fh(&file->f_handle, f)) |
71 | goto found; | 98 | goto found; |
72 | 99 | ||
73 | dprintk("lockd: creating file for (%08x %08x %08x %08x %08x %08x)\n", | 100 | nlm_debug_print_fh("creating file for", f); |
74 | fhp[0], fhp[1], fhp[2], fhp[3], fhp[4], fhp[5]); | ||
75 | 101 | ||
76 | nfserr = nlm_lck_denied_nolocks; | 102 | nfserr = nlm_lck_denied_nolocks; |
77 | file = (struct nlm_file *) kmalloc(sizeof(*file), GFP_KERNEL); | 103 | file = (struct nlm_file *) kmalloc(sizeof(*file), GFP_KERNEL); |
@@ -124,11 +150,10 @@ out_free: | |||
124 | static inline void | 150 | static inline void |
125 | nlm_delete_file(struct nlm_file *file) | 151 | nlm_delete_file(struct nlm_file *file) |
126 | { | 152 | { |
127 | struct inode *inode = file->f_file->f_dentry->d_inode; | ||
128 | struct nlm_file **fp, *f; | 153 | struct nlm_file **fp, *f; |
129 | 154 | ||
130 | dprintk("lockd: closing file %s/%ld\n", | 155 | nlm_debug_print_file("closing file", file); |
131 | inode->i_sb->s_id, inode->i_ino); | 156 | |
132 | fp = nlm_files + file->f_hash; | 157 | fp = nlm_files + file->f_hash; |
133 | while ((f = *fp) != NULL) { | 158 | while ((f = *fp) != NULL) { |
134 | if (f == file) { | 159 | if (f == file) { |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 6537f2c4ae44..b497c71384e8 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -655,7 +655,6 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t | |||
655 | struct file *file = iocb->ki_filp; | 655 | struct file *file = iocb->ki_filp; |
656 | struct nfs_open_context *ctx = | 656 | struct nfs_open_context *ctx = |
657 | (struct nfs_open_context *) file->private_data; | 657 | (struct nfs_open_context *) file->private_data; |
658 | struct dentry *dentry = file->f_dentry; | ||
659 | struct address_space *mapping = file->f_mapping; | 658 | struct address_space *mapping = file->f_mapping; |
660 | struct inode *inode = mapping->host; | 659 | struct inode *inode = mapping->host; |
661 | struct iovec iov = { | 660 | struct iovec iov = { |
@@ -664,7 +663,8 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t | |||
664 | }; | 663 | }; |
665 | 664 | ||
666 | dprintk("nfs: direct read(%s/%s, %lu@%lu)\n", | 665 | dprintk("nfs: direct read(%s/%s, %lu@%lu)\n", |
667 | dentry->d_parent->d_name.name, dentry->d_name.name, | 666 | file->f_dentry->d_parent->d_name.name, |
667 | file->f_dentry->d_name.name, | ||
668 | (unsigned long) count, (unsigned long) pos); | 668 | (unsigned long) count, (unsigned long) pos); |
669 | 669 | ||
670 | if (!is_sync_kiocb(iocb)) | 670 | if (!is_sync_kiocb(iocb)) |
@@ -730,7 +730,6 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, | |||
730 | struct file *file = iocb->ki_filp; | 730 | struct file *file = iocb->ki_filp; |
731 | struct nfs_open_context *ctx = | 731 | struct nfs_open_context *ctx = |
732 | (struct nfs_open_context *) file->private_data; | 732 | (struct nfs_open_context *) file->private_data; |
733 | struct dentry *dentry = file->f_dentry; | ||
734 | struct address_space *mapping = file->f_mapping; | 733 | struct address_space *mapping = file->f_mapping; |
735 | struct inode *inode = mapping->host; | 734 | struct inode *inode = mapping->host; |
736 | struct iovec iov = { | 735 | struct iovec iov = { |
@@ -739,8 +738,9 @@ nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, size_t count, | |||
739 | }; | 738 | }; |
740 | 739 | ||
741 | dfprintk(VFS, "nfs: direct write(%s/%s(%ld), %lu@%lu)\n", | 740 | dfprintk(VFS, "nfs: direct write(%s/%s(%ld), %lu@%lu)\n", |
742 | dentry->d_parent->d_name.name, dentry->d_name.name, | 741 | file->f_dentry->d_parent->d_name.name, |
743 | inode->i_ino, (unsigned long) count, (unsigned long) pos); | 742 | file->f_dentry->d_name.name, inode->i_ino, |
743 | (unsigned long) count, (unsigned long) pos); | ||
744 | 744 | ||
745 | if (!is_sync_kiocb(iocb)) | 745 | if (!is_sync_kiocb(iocb)) |
746 | goto out; | 746 | goto out; |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 1bdbd4f9fdd2..8f71e766cc5d 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -734,14 +734,14 @@ int nfs_updatepage(struct file *file, struct page *page, | |||
734 | unsigned int offset, unsigned int count) | 734 | unsigned int offset, unsigned int count) |
735 | { | 735 | { |
736 | struct nfs_open_context *ctx = (struct nfs_open_context *)file->private_data; | 736 | struct nfs_open_context *ctx = (struct nfs_open_context *)file->private_data; |
737 | struct dentry *dentry = file->f_dentry; | ||
738 | struct inode *inode = page->mapping->host; | 737 | struct inode *inode = page->mapping->host; |
739 | struct nfs_page *req; | 738 | struct nfs_page *req; |
740 | int status = 0; | 739 | int status = 0; |
741 | 740 | ||
742 | dprintk("NFS: nfs_updatepage(%s/%s %d@%Ld)\n", | 741 | dprintk("NFS: nfs_updatepage(%s/%s %d@%Ld)\n", |
743 | dentry->d_parent->d_name.name, dentry->d_name.name, | 742 | file->f_dentry->d_parent->d_name.name, |
744 | count, (long long)(page_offset(page) +offset)); | 743 | file->f_dentry->d_name.name, count, |
744 | (long long)(page_offset(page) +offset)); | ||
745 | 745 | ||
746 | if (IS_SYNC(inode)) { | 746 | if (IS_SYNC(inode)) { |
747 | status = nfs_writepage_sync(ctx, inode, page, offset, count, 0); | 747 | status = nfs_writepage_sync(ctx, inode, page, offset, count, 0); |
@@ -850,7 +850,6 @@ static void nfs_write_rpcsetup(struct nfs_page *req, | |||
850 | unsigned int count, unsigned int offset, | 850 | unsigned int count, unsigned int offset, |
851 | int how) | 851 | int how) |
852 | { | 852 | { |
853 | struct rpc_task *task = &data->task; | ||
854 | struct inode *inode; | 853 | struct inode *inode; |
855 | 854 | ||
856 | /* Set up the RPC argument and reply structs | 855 | /* Set up the RPC argument and reply structs |
@@ -881,7 +880,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req, | |||
881 | data->task.tk_release = nfs_writedata_release; | 880 | data->task.tk_release = nfs_writedata_release; |
882 | 881 | ||
883 | dprintk("NFS: %4d initiated write call (req %s/%Ld, %u bytes @ offset %Lu)\n", | 882 | dprintk("NFS: %4d initiated write call (req %s/%Ld, %u bytes @ offset %Lu)\n", |
884 | task->tk_pid, | 883 | data->task.tk_pid, |
885 | inode->i_sb->s_id, | 884 | inode->i_sb->s_id, |
886 | (long long)NFS_FILEID(inode), | 885 | (long long)NFS_FILEID(inode), |
887 | count, | 886 | count, |
@@ -1217,7 +1216,6 @@ static void nfs_commit_release(struct rpc_task *task) | |||
1217 | static void nfs_commit_rpcsetup(struct list_head *head, | 1216 | static void nfs_commit_rpcsetup(struct list_head *head, |
1218 | struct nfs_write_data *data, int how) | 1217 | struct nfs_write_data *data, int how) |
1219 | { | 1218 | { |
1220 | struct rpc_task *task = &data->task; | ||
1221 | struct nfs_page *first; | 1219 | struct nfs_page *first; |
1222 | struct inode *inode; | 1220 | struct inode *inode; |
1223 | 1221 | ||
@@ -1248,7 +1246,7 @@ static void nfs_commit_rpcsetup(struct list_head *head, | |||
1248 | /* Release requests */ | 1246 | /* Release requests */ |
1249 | data->task.tk_release = nfs_commit_release; | 1247 | data->task.tk_release = nfs_commit_release; |
1250 | 1248 | ||
1251 | dprintk("NFS: %4d initiated commit call\n", task->tk_pid); | 1249 | dprintk("NFS: %4d initiated commit call\n", data->task.tk_pid); |
1252 | } | 1250 | } |
1253 | 1251 | ||
1254 | /* | 1252 | /* |