[Pvfs2-cvs] commit by slang in pvfs2/src/kernel/linux-2.6: dcache.c
dir.c file.c inode.c pvfs2-kernel.h pvfs2-utils.c super.c
CVS commit program
cvs at parl.clemson.edu
Wed May 21 14:55:28 EDT 2008
Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv7682/src/kernel/linux-2.6
Modified Files:
Tag: he-branch
dcache.c dir.c file.c inode.c pvfs2-kernel.h pvfs2-utils.c
super.c
Log Message:
reverse merge of latest changes from HEAD to he branch.
Index: dcache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/dcache.c,v
diff -p -u -r1.40 -r1.40.4.1
--- dcache.c 25 Mar 2008 23:55:43 -0000 1.40
+++ dcache.c 21 May 2008 18:55:27 -0000 1.40.4.1
@@ -109,9 +109,9 @@ static int pvfs2_d_revalidate_common(str
gossip_debug(GOSSIP_DCACHE_DEBUG,
"%s: doing getattr: inode: %p, handle: %llu)\n",
__func__, inode, llu(get_handle_from_ino(inode)));
- mutex_lock(&inode->i_mutex);
+ pvfs2_inode_lock(inode);
ret = pvfs2_inode_getattr(inode, PVFS_ATTR_SYS_ALL_NOHINT);
- mutex_unlock(&inode->i_mutex);
+ pvfs2_inode_unlock(inode);
gossip_debug(GOSSIP_DCACHE_DEBUG,
"%s: getattr %s (ret = %d), returning %s for dentry\n",
__func__,
Index: dir.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/dir.c,v
diff -p -u -r1.54 -r1.54.4.1
--- dir.c 4 Feb 2008 16:38:21 -0000 1.54
+++ dir.c 21 May 2008 18:55:27 -0000 1.54.4.1
@@ -294,6 +294,14 @@ static int pvfs2_readdir(
}
}
+ /* did we hit the end of the directory? */
+ if(rhandle.readdir_response.token == PVFS_READDIR_END)
+ {
+ gossip_debug(GOSSIP_DIR_DEBUG,
+ "End of dir detected; setting f_pos to PVFS_READDIR_END.\n");
+ file->f_pos = PVFS_READDIR_END;
+ }
+
gossip_debug(GOSSIP_DIR_DEBUG,
"pos = %llu, file->f_pos should have been %ld\n",
llu(pos),
Index: file.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/file.c,v
diff -p -u -r1.146 -r1.146.4.1
--- file.c 26 Feb 2008 16:29:15 -0000 1.146
+++ file.c 21 May 2008 18:55:27 -0000 1.146.4.1
@@ -1130,7 +1130,7 @@ out:
static ssize_t wait_for_cached_io(struct rw_options *old_rw, struct iovec *vec,
int nr_segs, size_t total_size)
{
- ssize_t err = 0, total_actual_io;
+ ssize_t err = 0, total_actual_io = 0;
struct rw_options rw;
loff_t isize, offset;
Index: inode.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/inode.c,v
diff -p -u -r1.81 -r1.81.4.1
--- inode.c 26 Feb 2008 16:29:15 -0000 1.81
+++ inode.c 21 May 2008 18:55:27 -0000 1.81.4.1
@@ -133,7 +133,7 @@ static int pvfs2_releasepage(struct page
struct backing_dev_info pvfs2_backing_dev_info =
{
- .ra_pages = 1024,
+ .ra_pages = 0,
#ifdef HAVE_BDI_MEMORY_BACKED
/* old interface, up through 2.6.11 */
.memory_backed = 1 /* does not contribute to dirty memory */
@@ -244,7 +244,21 @@ int pvfs2_getattr(
int ret = -ENOENT;
struct inode *inode = dentry->d_inode;
- gossip_debug(GOSSIP_INODE_DEBUG, "pvfs2_getattr: called on %s\n", dentry->d_name.name);
+ gossip_debug(GOSSIP_INODE_DEBUG,
+ "pvfs2_getattr: called on %s\n", dentry->d_name.name);
+
+ /* This seems to be the only place to reliably detect mount options
+ * parsed by the VFS layer. Propigate them to our internal sb structure so
+ * that we can handle lazy time updates properly.
+ */
+ if(mnt->mnt_flags && MNT_NOATIME)
+ {
+ inode->i_sb->s_flags |= MS_NOATIME;
+ }
+ if(mnt->mnt_flags && MNT_NODIRATIME)
+ {
+ inode->i_sb->s_flags |= MS_NODIRATIME;
+ }
/*
* Similar to the above comment, a getattr also expects that all fields/attributes
Index: pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h,v
diff -p -u -r1.150 -r1.150.4.1
--- pvfs2-kernel.h 25 Mar 2008 19:21:22 -0000 1.150
+++ pvfs2-kernel.h 21 May 2008 18:55:27 -0000 1.150.4.1
@@ -459,6 +459,8 @@ typedef struct
struct super_block *sb;
int mount_pending;
struct list_head list;
+ atomic_t pvfs2_inode_alloc_count;
+ atomic_t pvfs2_inode_dealloc_count;
} pvfs2_sb_info_t;
/** a temporary structure used only for sb mount time that groups the
@@ -1225,17 +1227,29 @@ static inline int dcache_dir_close(struc
#endif /* PVFS2_LINUX_KERNEL_2_4 */
+#ifdef HAVE_I_SEM_IN_STRUCT_INODE
+#define pvfs2_inode_lock(__i) do \
+{ down(&(__i)->i_sem); } while (0)
+#define pvfs2_inode_unlock(__i) do \
+{ up(&(__i)->i_sem); } while (0)
+#else
+#define pvfs2_inode_lock(__i) do \
+{ mutex_lock(&(__i)->i_mutex); } while (0)
+#define pvfs2_inode_unlock(__i) do \
+{ mutex_unlock(&(__i)->i_mutex); } while (0)
+#endif /* HAVE_I_SEM_IN_STRUCT_INODE */
+
static inline void pvfs2_i_size_write(struct inode *inode, loff_t i_size)
{
#ifndef HAVE_I_SIZE_WRITE
inode->i_size = i_size;
#else
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
- mutex_lock(&inode->i_mutex);
+ pvfs2_inode_lock(inode);
#endif
i_size_write(inode, i_size);
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
- mutex_unlock(&inode->i_mutex);
+ pvfs2_inode_unlock(inode);
#endif
#endif
return;
Index: pvfs2-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-utils.c,v
diff -p -u -r1.151 -r1.151.4.1
--- pvfs2-utils.c 25 Mar 2008 19:21:22 -0000 1.151
+++ pvfs2-utils.c 21 May 2008 18:55:27 -0000 1.151.4.1
@@ -613,6 +613,7 @@ int pvfs2_flush_inode(struct inode *inod
* b) object is a directory and has a nodiratime marker on the fs
* c) entire file system is mounted with noatime option
*/
+
if (!((inode->i_flags & S_NOATIME)
|| (inode->i_sb->s_flags & MS_NOATIME)
|| ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))) && AtimeFlag(pvfs2_inode))
@@ -623,16 +624,18 @@ int pvfs2_flush_inode(struct inode *inod
{
wbattr.ia_mode = inode->i_mode;
wbattr.ia_valid |= ATTR_MODE;
- gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_flush_inode (%llu) writing mode %o\n",
- llu(get_handle_from_ino(inode)), inode->i_mode);
}
gossip_debug(GOSSIP_UTILS_DEBUG, "*********** pvfs2_flush_inode: %llu "
"(ia_valid %d)\n", llu(get_handle_from_ino(inode)), wbattr.ia_valid);
if (wbattr.ia_valid == 0)
{
+ gossip_debug(GOSSIP_UTILS_DEBUG, "pvfs2_flush_inode skipping setattr()\n");
return 0;
}
+
+ gossip_debug(GOSSIP_UTILS_DEBUG, "pvfs2_flush_inode (%llu) writing mode %o\n",
+ llu(get_handle_from_ino(inode)), inode->i_mode);
ret = pvfs2_inode_setattr(inode, &wbattr);
return ret;
Index: super.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/super.c,v
diff -p -u -r1.97 -r1.97.4.1
--- super.c 19 Feb 2008 17:38:09 -0000 1.97
+++ super.c 21 May 2008 18:55:27 -0000 1.97.4.1
@@ -17,7 +17,6 @@ spinlock_t pvfs2_superblocks_lock = SPIN
#ifdef HAVE_GET_FS_KEY_SUPER_OPERATIONS
static void pvfs2_sb_get_fs_key(struct super_block *sb, char **ppkey, int *keylen);
#endif
-static atomic_t pvfs2_inode_alloc_count, pvfs2_inode_dealloc_count;
static char *keywords[] = {"intr", "acl", "suid", "noatime", "nodiratime"};
static int num_possible_keywords = sizeof(keywords)/sizeof(char *);
@@ -149,6 +148,7 @@ static int parse_mount_options(
/* option string did not match any of the known keywords */
if (j == num_possible_keywords)
{
+#ifdef PVFS2_LINUX_KERNEL_2_4
/* assume we have a device name */
if (got_device == 0)
{
@@ -167,6 +167,13 @@ static int parse_mount_options(
gossip_debug(GOSSIP_SUPER_DEBUG, "pvfs2: multiple device names specified: "
"ignoring %s\n", options[i]);
}
+#else
+ /* in the 2.6 kernel, we don't pass device name through this
+ * path; we must have gotten an unsupported option.
+ */
+ gossip_err("Error: mount option [%s] is not supported.\n", options[i]);
+ return(-EINVAL);
+#endif
}
}
}
@@ -193,7 +200,7 @@ static struct inode *pvfs2_alloc_inode(s
{
new_inode = &pvfs2_inode->vfs_inode;
gossip_debug(GOSSIP_SUPER_DEBUG, "pvfs2_alloc_inode: allocated %p\n", pvfs2_inode);
- atomic_inc(&pvfs2_inode_alloc_count);
+ atomic_inc(&(PVFS2_SB(sb)->pvfs2_inode_alloc_count));
new_inode->i_flags &= ~(S_APPEND|S_IMMUTABLE|S_NOATIME);
}
return new_inode;
@@ -208,7 +215,7 @@ static void pvfs2_destroy_inode(struct i
gossip_debug(GOSSIP_SUPER_DEBUG, "pvfs2_destroy_inode: deallocated %p destroying inode %llu\n",
pvfs2_inode, llu(get_handle_from_ino(inode)));
- atomic_inc(&pvfs2_inode_dealloc_count);
+ atomic_inc(&(PVFS2_SB(inode->i_sb)->pvfs2_inode_dealloc_count));
pvfs2_inode_finalize(pvfs2_inode);
pvfs2_inode_release(pvfs2_inode);
}
@@ -536,7 +543,7 @@ int pvfs2_remount(
if (sb && PVFS2_SB(sb))
{
- if (data)
+ if (data && data[0] != '\0')
{
ret = parse_mount_options(data, sb, 1);
if (ret)
@@ -1307,8 +1314,8 @@ void pvfs2_kill_sb(
#endif
{
int count1, count2;
- count1 = atomic_read(&pvfs2_inode_alloc_count);
- count2 = atomic_read(&pvfs2_inode_dealloc_count);
+ count1 = atomic_read(&(PVFS2_SB(sb)->pvfs2_inode_alloc_count));
+ count2 = atomic_read(&(PVFS2_SB(sb)->pvfs2_inode_dealloc_count));
if (count1 != count2)
{
gossip_err("pvfs2_kill_sb: (WARNING) number of inode allocs (%d) != number of inode deallocs (%d)\n",
More information about the Pvfs2-cvs
mailing list